60cvar_t r_damageblur = {
CF_CLIENT |
CF_ARCHIVE,
"r_damageblur",
"0",
"screen motionblur based on damage - value represents intensity, somewhere around 0.5 recommended - NOTE: bad performance on multi-gpu!"};
72cvar_t r_depthfirst = {
CF_CLIENT |
CF_ARCHIVE,
"r_depthfirst",
"0",
"renders a depth-only version of the scene before normal rendering begins to eliminate overdraw, values: 0 = off, 1 = world depth, 2 = world and model depth"};
83cvar_t r_showbboxes = {
CF_CLIENT,
"r_showbboxes",
"0",
"shows bounding boxes of server entities, value controls opacity scaling (1 = 10%, 10 = 100%)"};
85cvar_t r_showsurfaces = {
CF_CLIENT,
"r_showsurfaces",
"0",
"1 shows surfaces as different colors, or a value of 3 shows an approximation to vertex or object color (for a very approximate view of the game)"};
88cvar_t r_showlighting = {
CF_CLIENT,
"r_showlighting",
"0",
"shows areas lit by lights, useful for finding out why some areas of a map render slowly (bright orange = lots of passes = slow), a value of 2 disables depth testing which can be interesting but not very useful"};
93cvar_t r_showspriteedges = {
CF_CLIENT,
"r_showspriteedges",
"0",
"renders a debug outline to show the polygon shape of each sprite frame rendered (may be 2 or more in case of interpolated animations), for debugging rendering bugs with specific view types"};
94cvar_t r_showparticleedges = {
CF_CLIENT,
"r_showparticleedges",
"0",
"renders a debug outline to show the polygon shape of each particle, for debugging rendering bugs with specific view types"};
104cvar_t r_cullentities_trace_tempentitysamples = {
CF_CLIENT,
"r_cullentities_trace_tempentitysamples",
"-1",
"number of samples to test for entity culling of temp entities (including all CSQC entities), -1 disables trace culling on these entities to prevent flicker (pvs still applies)"};
114cvar_t r_fullbright_directed = {
CF_CLIENT,
"r_fullbright_directed",
"0",
"render fullbright things (unlit worldmodel and EF_FULLBRIGHT entities, but not fullbright shaders) using a constant light direction instead to add more depth while keeping uniform brightness"};
123cvar_t r_shadows = {
CF_CLIENT |
CF_ARCHIVE,
"r_shadows",
"0",
"casts fake stencil shadows from models onto the world (rtlights are unaffected by this); when set to 2, always cast the shadows in the direction set by r_shadows_throwdirection, otherwise use the model lighting."};
127cvar_t r_shadows_drawafterrtlighting = {
CF_CLIENT |
CF_ARCHIVE,
"r_shadows_drawafterrtlighting",
"0",
"draw fake shadows AFTER realtime lightning is drawn. May be useful for simulating fast sunlight on large outdoor maps with only one noshadow rtlight. The price is less realistic appearance of dynamic light shadows."};
160cvar_t r_viewfbo = {
CF_CLIENT |
CF_ARCHIVE,
"r_viewfbo",
"0",
"enables use of an 8bit (1) or 16bit (2) or 32bit (3) per component float framebuffer render, which may be at a different resolution than the video mode; the default setting of 0 uses a framebuffer render when required, and renders directly to the screen otherwise"};
161cvar_t r_rendertarget_debug = {
CF_CLIENT,
"r_rendertarget_debug",
"-1",
"replaces the view with the contents of the specified render target (by number - note that these can fluctuate depending on scene)"};
162cvar_t r_viewscale = {
CF_CLIENT |
CF_ARCHIVE,
"r_viewscale",
"1",
"scaling factor for resolution of the fbo rendering method, must be > 0, can be above 1 for a costly antialiasing behavior, typical values are 0.5 for 1/4th as many pixels rendered, or 1 for normal rendering"};
200cvar_t r_water_hideplayer = {
CF_CLIENT |
CF_ARCHIVE,
"r_water_hideplayer",
"0",
"if set to 1 then player will be hidden in refraction views, if set to 2 then player will also be hidden in reflection views, player is always visible in camera views"};
204cvar_t r_nolerp_list = {
CF_CLIENT |
CF_ARCHIVE,
"r_nolerp_list",
"progs/v_nail.mdl,progs/v_nail2.mdl,progs/flame.mdl,progs/flame2.mdl,progs/braztall.mdl,progs/brazshrt.mdl,progs/longtrch.mdl,progs/flame_pyre.mdl,progs/v_saw.mdl,progs/v_xfist.mdl,progs/h2stuff/newfire.mdl",
"comma separated list of models that will not have their animations smoothed"};
229cvar_t r_smoothnormals_areaweighting = {
CF_CLIENT,
"r_smoothnormals_areaweighting",
"1",
"uses significantly faster (and supposedly higher quality) area-weighted vertex normals and tangent vectors rather than summing normalized triangle normals and tangents"};
233cvar_t gl_lightmaps = {
CF_CLIENT,
"gl_lightmaps",
"0",
"draws only lightmaps, no texture (for level designers), a value of 2 keeps normalmap shading"};
235cvar_t r_test = {
CF_CLIENT,
"r_test",
"0",
"internal development use only, leave it alone (usually does nothing anyway)"};
237cvar_t r_batch_multidraw = {
CF_CLIENT |
CF_ARCHIVE,
"r_batch_multidraw",
"1",
"issue multiple glDrawElements calls when rendering a batch of surfaces with the same texture (otherwise the index data is copied to make it one draw)"};
252 {
CF_CLIENT |
CF_ARCHIVE,
"r_buffermegs_index16",
"1",
"index buffer size for one frame (16bit indices)"},
253 {
CF_CLIENT |
CF_ARCHIVE,
"r_buffermegs_index32",
"1",
"index buffer size for one frame (32bit indices)"},
254 {
CF_CLIENT |
CF_ARCHIVE,
"r_buffermegs_uniform",
"0.25",
"uniform buffer size for one frame"},
258cvar_t r_q1bsp_lightmap_updates_combine = {
CF_CLIENT |
CF_ARCHIVE,
"r_q1bsp_lightmap_updates_combine",
"2",
"combine lightmap texture updates to make fewer glTexSubImage2D calls, modes: 0 = immediately upload lightmaps (may be thousands of small 3x3 updates), 1 = combine to one call, 2 = combine to one full texture update (glTexImage2D) which tells the driver it does not need to lock the resource (faster on most drivers)"};
324 for (
i = 0;
i < verts;
i++)
338 for (
i = 0;
i < verts;
i++)
373 unsigned char data[4];
403 unsigned char data[6*1*1*4];
422 s = (
x + 0.5f) * (2.0f /
NORMSIZE) - 1.0f;
423 t = (
y + 0.5f) * (2.0f /
NORMSIZE) - 1.0f;
570 for (
j =
x;
j <=
y;
j++)
578 for (
j =
x;
j >=
y;
j--)
627 {
"#define USEDIFFUSE\n",
" diffuse"},
628 {
"#define USEVERTEXTEXTUREBLEND\n",
" vertextextureblend"},
629 {
"#define USEVIEWTINT\n",
" viewtint"},
630 {
"#define USECOLORMAPPING\n",
" colormapping"},
631 {
"#define USESATURATION\n",
" saturation"},
632 {
"#define USEFOGINSIDE\n",
" foginside"},
633 {
"#define USEFOGOUTSIDE\n",
" fogoutside"},
634 {
"#define USEFOGHEIGHTTEXTURE\n",
" fogheighttexture"},
635 {
"#define USEFOGALPHAHACK\n",
" fogalphahack"},
636 {
"#define USEGAMMARAMPS\n",
" gammaramps"},
637 {
"#define USECUBEFILTER\n",
" cubefilter"},
638 {
"#define USEGLOW\n",
" glow"},
639 {
"#define USEBLOOM\n",
" bloom"},
640 {
"#define USESPECULAR\n",
" specular"},
641 {
"#define USEPOSTPROCESSING\n",
" postprocessing"},
642 {
"#define USEREFLECTION\n",
" reflection"},
643 {
"#define USEOFFSETMAPPING\n",
" offsetmapping"},
644 {
"#define USEOFFSETMAPPING_RELIEFMAPPING\n",
" reliefmapping"},
645 {
"#define USESHADOWMAP2D\n",
" shadowmap2d"},
646 {
"#define USESHADOWMAPVSDCT\n",
" shadowmapvsdct"},
647 {
"#define USESHADOWMAPORTHO\n",
" shadowmaportho"},
648 {
"#define USEDEFERREDLIGHTMAP\n",
" deferredlightmap"},
649 {
"#define USEALPHAKILL\n",
" alphakill"},
650 {
"#define USEREFLECTCUBE\n",
" reflectcube"},
651 {
"#define USENORMALMAPSCROLLBLEND\n",
" normalmapscrollblend"},
652 {
"#define USEBOUNCEGRID\n",
" bouncegrid"},
653 {
"#define USEBOUNCEGRIDDIRECTIONAL\n",
" bouncegriddirectional"},
654 {
"#define USETRIPPY\n",
" trippy"},
655 {
"#define USEDEPTHRGB\n",
" depthrgb"},
656 {
"#define USEALPHAGENVERTEX\n",
" alphagenvertex"},
657 {
"#define USESKELETAL\n",
" skeletal"},
658 {
"#define USEOCCLUDE\n",
" occlude"}
672 {
"combined",
"glsl",
builtinshaderstrings,
"#define MODE_LIGHTDIRECTIONMAP_MODELSPACE\n",
" lightdirectionmap_modelspace"},
673 {
"combined",
"glsl",
builtinshaderstrings,
"#define MODE_LIGHTDIRECTIONMAP_TANGENTSPACE\n",
" lightdirectionmap_tangentspace"},
674 {
"combined",
"glsl",
builtinshaderstrings,
"#define MODE_LIGHTDIRECTIONMAP_FORCED_LIGHTMAP\n",
" lightdirectionmap_forced_lightmap"},
675 {
"combined",
"glsl",
builtinshaderstrings,
"#define MODE_LIGHTDIRECTIONMAP_FORCED_VERTEXCOLOR\n",
" lightdirectionmap_forced_vertexcolor"},
681 {
"combined",
"glsl",
builtinshaderstrings,
"#define MODE_DEFERREDGEOMETRY\n",
" deferredgeometry"},
682 {
"combined",
"glsl",
builtinshaderstrings,
"#define MODE_DEFERREDLIGHTSOURCE\n",
" deferredlightsource"},
828#define SHADERPERMUTATION_HASHSIZE 256
851#define SHADERSTATICPARMS_COUNT 15
857#define R_COMPILESHADER_STATICPARM_ENABLE(p) r_compileshader_staticparms[(p) >> 5] |= (1 << ((p) & 0x1F))
906#define R_COMPILESHADER_STATICPARM_EMIT(p, n) \
907 if(r_compileshader_staticparms[(p) >> 5] & (1 << ((p) & 0x1F))) \
908 shaderstaticparmstrings_list[shaderstaticparms_count++] = "#define " n "\n"; \
910 shaderstaticparmstrings_list[shaderstaticparms_count++] = "\n"
968 const char **p = strings;
971 for (p = strings;(t = *p);p++)
976 for (p = strings;(t = *p);p++)
1106 if (permutation & (1ll<<
i))
1367 if (!(permutation &
j))
1444 FS_Print(file,
"/* The engine may define the following macros:\n");
1445 FS_Print(file,
"#define VERTEX_SHADER\n#define GEOMETRY_SHADER\n#define FRAGMENT_SHADER\n");
1517#define BLENDFUNC_ALLOWS_COLORMOD 1
1518#define BLENDFUNC_ALLOWS_FOG 2
1519#define BLENDFUNC_ALLOWS_FOG_HACK0 4
1520#define BLENDFUNC_ALLOWS_FOG_HACKALPHA 8
1521#define BLENDFUNC_ALLOWS_ANYFOG (BLENDFUNC_ALLOWS_FOG | BLENDFUNC_ALLOWS_FOG_HACK0 | BLENDFUNC_ALLOWS_FOG_HACKALPHA)
1570 unsigned int mode = 0;
2098 unsigned int mode = 0;
2113 if (diffusescale > 0)
2157#define SKINFRAME_HASH 1024
2253 item->comparewidth == comparewidth &&
2254 item->compareheight == compareheight &&
2255 item->comparecrc == comparecrc)
2266 item->comparewidth = comparewidth;
2267 item->compareheight = compareheight;
2268 item->comparecrc = comparecrc;
2279#define R_SKINFRAME_LOAD_AVERAGE_COLORS(cnt, getpixel) \
2281 unsigned long long avgcolor[5], wsum; \
2289 for(pix = 0; pix < cnt; ++pix) \
2292 for(comp = 0; comp < 3; ++comp) \
2299 for(comp = 0; comp < 3; ++comp) \
2300 avgcolor[comp] += getpixel * w; \
2304 avgcolor[4] += getpixel; \
2306 if(avgcolor[3] == 0) \
2308 skinframe->avgcolor[0] = avgcolor[2] / (255.0 * avgcolor[3]); \
2309 skinframe->avgcolor[1] = avgcolor[1] / (255.0 * avgcolor[3]); \
2310 skinframe->avgcolor[2] = avgcolor[0] / (255.0 * avgcolor[3]); \
2311 skinframe->avgcolor[3] = avgcolor[4] / (255.0 * cnt); \
2323 if (skinframe && skinframe->
base)
2354 if (!
r_loaddds || !(
ddsbase =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s.dds", basename),
vid.
sRGB3D, textureflags, &
ddshasalpha,
ddsavgcolor, miplevel,
false)))
2391 skinframe->
fog =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s_mask.dds", skinframe->
basename),
false, textureflags |
TEXF_ALPHA,
NULL,
NULL, miplevel,
true);
2420 skinframe->
fog =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_mask", skinframe->
basename),
image_width,
image_height,
pixels,
TEXTYPE_BGRA, textureflags & (
gl_texturecompression_color.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS), miplevel,
NULL);
2438 skinframe->
nmap =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s_norm.dds", skinframe->
basename),
false, (
TEXF_ALPHA | textureflags) & (
r_mipnormalmaps.
integer ? ~0 :
~TEXF_MIPMAP),
NULL,
NULL,
mymiplevel,
true);
2439 skinframe->
glow =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s_glow.dds", skinframe->
basename),
vid.
sRGB3D, textureflags,
NULL,
NULL,
mymiplevel,
true);
2441 skinframe->
gloss =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s_gloss.dds", skinframe->
basename),
vid.
sRGB3D, textureflags,
NULL,
NULL,
mymiplevel,
true);
2442 skinframe->
pants =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s_pants.dds", skinframe->
basename),
vid.
sRGB3D, textureflags,
NULL,
NULL,
mymiplevel,
true);
2443 skinframe->
shirt =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s_shirt.dds", skinframe->
basename),
vid.
sRGB3D, textureflags,
NULL,
NULL,
mymiplevel,
true);
2444 skinframe->
reflect =
R_LoadTextureDDSFile(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"dds/%s_reflect.dds", skinframe->
basename),
vid.
sRGB3D, textureflags,
NULL,
NULL,
mymiplevel,
true);
2453 skinframe->
nmap =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_nmap", skinframe->
basename),
image_width,
image_height,
pixels,
TEXTYPE_BGRA, (
TEXF_ALPHA | textureflags) & (
r_mipnormalmaps.
integer ? ~0 :
~TEXF_MIPMAP) & (
gl_texturecompression_normal.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2461 skinframe->
nmap =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_nmap", skinframe->
basename),
image_width,
image_height,
pixels,
TEXTYPE_BGRA, (
TEXF_ALPHA | textureflags) & (
r_mipnormalmaps.
integer ? ~0 :
~TEXF_MIPMAP) & (
gl_texturecompression_normal.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2469 skinframe->
nmap =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_nmap", skinframe->
basename),
basepixels_width,
basepixels_height,
pixels,
TEXTYPE_BGRA, (
TEXF_ALPHA | textureflags) & (
r_mipnormalmaps.
integer ? ~0 :
~TEXF_MIPMAP) & (
gl_texturecompression_normal.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2482 if (skinframe->
glow ==
NULL && ((
pixels =
loadimagepixelsbgra(
va(
vabuf,
sizeof(
vabuf),
"%s_glow", skinframe->
basename),
false,
false,
false, &
mymiplevel)) || (
pixels =
loadimagepixelsbgra(
va(
vabuf,
sizeof(
vabuf),
"%s.blend", skinframe->
basename),
false,
false,
false, &
mymiplevel)) || (
pixels =
loadimagepixelsbgra(
va(
vabuf,
sizeof(
vabuf),
"%s_blend", skinframe->
basename),
false,
false,
false, &
mymiplevel)) || (
pixels =
loadimagepixelsbgra(
va(
vabuf,
sizeof(
vabuf),
"%s_luma", skinframe->
basename),
false,
false,
false, &
mymiplevel))))
2484 skinframe->
glow =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_glow", skinframe->
basename),
image_width,
image_height,
pixels,
vid.
sRGB3D ?
TEXTYPE_SRGB_BGRA :
TEXTYPE_BGRA, textureflags & (
gl_texturecompression_glow.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2495 skinframe->
gloss =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_gloss", skinframe->
basename),
image_width,
image_height,
pixels,
vid.
sRGB3D ?
TEXTYPE_SRGB_BGRA :
TEXTYPE_BGRA, (
TEXF_ALPHA | textureflags) & (
gl_texturecompression_gloss.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2507 skinframe->
pants =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_pants", skinframe->
basename),
image_width,
image_height,
pixels,
vid.
sRGB3D ?
TEXTYPE_SRGB_BGRA :
TEXTYPE_BGRA, textureflags & (
gl_texturecompression_color.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2519 skinframe->
shirt =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_shirt", skinframe->
basename),
image_width,
image_height,
pixels,
vid.
sRGB3D ?
TEXTYPE_SRGB_BGRA :
TEXTYPE_BGRA, textureflags & (
gl_texturecompression_color.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2531 skinframe->
reflect =
R_LoadTexture2D (
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_reflect", skinframe->
basename),
image_width,
image_height,
pixels,
vid.
sRGB3D ?
TEXTYPE_SRGB_BGRA :
TEXTYPE_BGRA, textureflags & (
gl_texturecompression_reflectmask.
integer &&
gl_texturecompression.
integer ? ~0 :
~TEXF_COMPRESS),
mymiplevel,
NULL);
2556 skinframe =
R_SkinFrame_Find(
name, textureflags, comparewidth, compareheight, comparecrc,
true);
2557 if (skinframe->
base)
2585 skinframe->
nmap =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_nmap", skinframe->
basename),
width,
height,
b,
TEXTYPE_BGRA, (textureflags |
TEXF_ALPHA) & (
r_mipnormalmaps.
integer ? ~0 :
~TEXF_MIPMAP), -1,
NULL);
2605 skinframe->
fog =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_fog", skinframe->
basename),
width,
height,
fogpixels,
TEXTYPE_BGRA, textureflags, -1,
NULL);
2627 if (skinframe->
base)
2706 unsigned char *
a, *
b;
2713 skinframe->
nmap =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_nmap", skinframe->
basename),
width,
height,
b,
TEXTYPE_BGRA, (skinframe->
textureflags |
TEXF_ALPHA) & (
r_mipnormalmaps.
integer ? ~0 :
~TEXF_MIPMAP), -1,
NULL);
2721 skinframe->
glow =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_glow", skinframe->
basename),
width,
height,
skindata,
vid.
sRGB3D ?
TEXTYPE_SRGB_PALETTE :
TEXTYPE_PALETTE, skinframe->
textureflags |
TEXF_ALPHA, -1,
palette_bgra_onlyfullbrights_transparent);
2723 skinframe->
glow =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_glow", skinframe->
basename),
width,
height,
skindata,
vid.
sRGB3D ?
TEXTYPE_SRGB_PALETTE :
TEXTYPE_PALETTE, skinframe->
textureflags, -1,
palette_bgra_onlyfullbrights);
2729 skinframe->
base =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_nospecial", skinframe->
basename),
width,
height,
skindata,
vid.
sRGB3D ?
TEXTYPE_SRGB_PALETTE :
TEXTYPE_PALETTE, skinframe->
textureflags, -1, skinframe->
glow ?
palette_bgra_nocolormapnofullbrights :
palette_bgra_nocolormap);
2730 skinframe->
pants =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_pants", skinframe->
basename),
width,
height,
skindata,
vid.
sRGB3D ?
TEXTYPE_SRGB_PALETTE :
TEXTYPE_PALETTE, skinframe->
textureflags, -1,
palette_bgra_pantsaswhite);
2731 skinframe->
shirt =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_shirt", skinframe->
basename),
width,
height,
skindata,
vid.
sRGB3D ?
TEXTYPE_SRGB_PALETTE :
TEXTYPE_PALETTE, skinframe->
textureflags, -1,
palette_bgra_shirtaswhite);
2760 if (skinframe->
base)
2788 if (((
unsigned char *)palette)[
skindata[
i]*4+3] < 255)
2795 skinframe->
fog =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"%s_fog", skinframe->
basename),
width,
height,
skindata,
TEXTYPE_PALETTE, textureflags, -1,
alphapalette);
2847 if (skinframe->
base)
2881 {
"px",
false,
false,
false},
2882 {
"nx",
false,
false,
false},
2883 {
"py",
false,
false,
false},
2884 {
"ny",
false,
false,
false},
2885 {
"pz",
false,
false,
false},
2886 {
"nz",
false,
false,
false}
2889 {
"posx",
false,
false,
false},
2890 {
"negx",
false,
false,
false},
2891 {
"posy",
false,
false,
false},
2892 {
"negy",
false,
false,
false},
2893 {
"posz",
false,
false,
false},
2894 {
"negz",
false,
false,
false}
2897 {
"rt",
true,
false,
true},
2898 {
"lf",
false,
true,
true},
2899 {
"ft",
true,
true,
false},
2900 {
"bk",
false,
false,
false},
2901 {
"up",
true,
false,
true},
2902 {
"dn",
true,
false,
true}
2917 if (basename && basename[0] ==
'!')
2930 for (
i = 0;
i < 6;
i++)
2962 Con_Printf(
"loading cubemap \"%s\"\n", basename);
2969 Con_DPrintf(
"failed to load cubemap \"%s\"\n", basename);
2973 for (
j = 0;
j < 3;
j++)
2974 for (
i = 0;
i < 6;
i++)
2976 Con_Print(
" and was unable to find any of them).\n");
3066#ifdef GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT
3118 Con_DPrintf(
"Compiling most used shaders for SS:BR android... START\n");
3132 Con_DPrintf(
"Compiling most used shaders for SS:BR android... END\n");
3152#if defined(GL_SAMPLES_PASSED) && !defined(USE_GLES2)
3410#ifdef DP_MOBILETOUCH
3440 out[0] = ((signbits & 1) ? mins : maxs)[0];
3441 out[1] = ((signbits & 2) ? mins : maxs)[1];
3442 out[2] = ((signbits & 4) ? mins : maxs)[2];
3452 for (
i = 0;
i < numplanes;
i++)
3473 return _R_CullBox(mins, maxs, numplanes, planes, -1);
3507 wantedsize =
bound(65536, wantedsize, 1000*1024*1024);
3512 newmem->data = (
unsigned char *)(((
size_t)(
newmem+1) + 15) & ~15);
3554 if (
sizeof(
size_t) >= 8)
3570 return (
void *)
data;
3598#define R_BUFFERDATA_CYCLE 3
3728 Sys_Error(
"R_BufferData_Store: failed to create a new buffer of sufficient size\n");
3808 wantnormals =
false;
3810 wanttangents =
false;
3811 if (!wantnormals && !wanttangents)
3832 if (wantnormals || wanttangents)
3861 if (wantnormals || wanttangents)
3890 long unsigned int i;
3899 { 0.5f, 0.5f, 0.5f },
3900 { 0.0f, 0.0f, 0.0f },
3901 { 0.0f, 0.0f, 1.0f },
3902 { 0.0f, 1.0f, 0.0f },
3903 { 0.0f, 1.0f, 1.0f },
3904 { 1.0f, 0.0f, 0.0f },
3905 { 1.0f, 0.0f, 1.0f },
3906 { 1.0f, 1.0f, 0.0f },
3907 { 1.0f, 1.0f, 1.0f },
3936 padmins[0] = boxmins[0] - pad;
3937 padmaxs[0] = boxmaxs[0] + pad;
3938 padmins[1] = boxmins[1] - pad;
3939 padmaxs[1] = boxmaxs[1] + pad;
3940 padmins[2] = boxmins[2] - pad;
3941 padmaxs[2] = boxmaxs[2] + pad;
3954 end[0] = boxmins[0] + (boxmaxs[0] - boxmins[0]) *
positions[
i][0];
3955 end[1] = boxmins[1] + (boxmaxs[1] - boxmins[1]) *
positions[
i][1];
3956 end[2] = boxmins[2] + (boxmaxs[2] - boxmins[2]) *
positions[
i][2];
3967 VectorMAM(0.5f, boxmins, 0.5f, boxmaxs, end);
3979 trace_t trace =
CL_TraceLine(start, end,
MOVE_NORMAL,
NULL,
SUPERCONTENTS_SOLID,
SUPERCONTENTS_SKY,
MATERIALFLAGMASK_TRANSLUCENT, 0.0f,
true,
false,
NULL,
true,
true);
4142static float irisvecs[7][3] = {{0, 0, 0}, {-1, 0, 0}, {1, 0, 0}, {0, -1, 0}, {0, 1, 0}, {0, 0, -1}, {0, 0, 1}};
4177 else if (current >
goal)
4226 nudge = 1.0 - 1.0 / (1<<23);
4408 R_Viewport_InitOrtho3D(&
r_refdef.
view.
viewport, &
r_refdef.
view.
matrix,
viewx,
viewy_adjusted,
viewwidth,
viewheight,
r_refdef.
view.
ortho_x,
r_refdef.
view.
ortho_y, -
r_refdef.
farclip,
r_refdef.
farclip,
customclipplane);
4412 R_Viewport_InitPerspective(&
r_refdef.
view.
viewport, &
r_refdef.
view.
matrix,
viewx,
viewy_adjusted,
viewwidth,
viewheight,
r_refdef.
view.
frustum_x,
r_refdef.
view.
frustum_y,
r_refdef.
nearclip,
r_refdef.
farclip,
customclipplane);
4450 R_Viewport_InitOrtho(&viewport, &
identitymatrix,
viewx,
viewy_adjusted,
viewwidth,
viewheight, 0, 0,
x2,
y2, -10, 100,
NULL);
4525 unsigned int i,
j, end;
4527 for (
i = 0;
i < end;
i++)
4537 for (
j = 0;
j <
sizeof(
r->colortexture) /
sizeof(
r->colortexture[0]);
j++)
4538 if (
r->colortexture[
j])
4540 if (
r->depthtexture)
4566 unsigned int i,
j, end;
4571 for (
i = 0;
i < end;
i++)
4582 r->textureheight = textureheight;
4587 r->depthtextype = depthtextype;
4588 r->depthisrenderbuffer = depthisrenderbuffer;
4589 for (
j = 0;
j < 4;
j++)
4590 if (
r->colortextype[
j])
4591 r->colortexture[
j] =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"rendertarget%i_%i_type%i",
i,
j, (
int)
r->colortextype[
j]),
r->texturewidth,
r->textureheight,
NULL,
r->colortextype[
j],
TEXF_RENDERTARGET |
TEXF_FORCELINEAR |
TEXF_CLAMP, -1,
NULL);
4592 if (
r->depthtextype)
4594 if (
r->depthisrenderbuffer)
4597 r->depthtexture =
R_LoadTexture2D(
r_main_texturepool,
va(
vabuf,
sizeof(
vabuf),
"rendertarget%i_depth_type%i",
i, (
int)
r->depthtextype),
r->texturewidth,
r->textureheight,
NULL,
r->depthtextype,
TEXF_RENDERTARGET |
TEXF_FORCELINEAR |
TEXF_CLAMP, -1,
NULL);
4610 int waterwidth, waterheight;
4621 waterwidth = waterheight = 0;
4665 mins[0] =
min(mins[0],
v[0]);
4666 mins[1] =
min(mins[1],
v[1]);
4667 mins[2] =
min(mins[2],
v[2]);
4668 maxs[0] =
max(maxs[0],
v[0]);
4669 maxs[1] =
max(maxs[1],
v[1]);
4670 maxs[2] =
max(maxs[2],
v[2]);
4673 VectorMAM(0.5f, mins, 0.5f, maxs, center);
4771 if (qualityreduction > 0)
4773 if (qualityreduction >= 1)
4782 if (qualityreduction >= 2)
4816 if (
rt->colortexture[0] ==
NULL ||
rt->depthtexture ==
NULL)
4869 if (
rt->colortexture[0] ==
NULL ||
rt->depthtexture ==
NULL)
4931 if (
rt->colortexture[0] ==
NULL ||
rt->depthtexture ==
NULL)
4999 Con_Printf(
"R_Water_ProcessPlanes: Error: texture creation failed! Turned off r_water.\n");
5002 if (qualityreduction > 0)
5004 if (qualityreduction >= 1)
5010 if (qualityreduction >= 2)
5021 int screentexturewidth, screentextureheight;
5066 scale =
bound(0.03125f, scale, 4.0f);
5124 R_Viewport_InitOrtho(&
bloomviewport, &
identitymatrix, 0, 0,
r_fb.
bloomwidth,
r_fb.
bloomheight, 0, 0, 1, 1, -10, 100,
NULL);
5135 GL_Color(colorscale, colorscale, colorscale, 1);
5333#define sscanf sscanf_s
5356 if (
rt &&
rt->colortexture[0])
5533#define RAMPWIDTH 256
5604 if(
a->model <
b->model)
5606 if(
a->model >
b->model)
5612 if(
a->skinnum <
b->skinnum)
5614 if(
a->skinnum >
b->skinnum)
6044 { 0, 0, 0, 1, 1, 1 },
6046 { 0, 0, 0, 0, 1, 0 },
6047 { 0, 0, 0, 1, 0, 0 },
6048 { 0, 1, 0, 1, 1, 0 },
6049 { 1, 0, 0, 1, 1, 0 },
6051 { 0, 0, 1, 0, 1, 1 },
6052 { 0, 0, 1, 1, 0, 1 },
6053 { 0, 1, 1, 1, 1, 1 },
6054 { 1, 0, 1, 1, 1, 1 },
6056 { 0, 0, 0, 0, 0, 1 },
6057 { 1, 0, 0, 1, 0, 1 },
6058 { 0, 1, 0, 0, 1, 1 },
6059 { 1, 1, 0, 1, 1, 1 },
6067 unsigned short elements[
BBOXEDGES * 36];
6080 for (
i = 0;
i < 3;
i++)
6093 for (
i = 0;
i < 36;
i++)
6099 for (
i = 0,
v = vertex3f, c = color4f;
i < numvertices;
i++,
v += 3, c += 4)
6125 for (
i = 0;
i < numsurfaces;
i++)
6208 0.0f, 0.0f, 0.5f, 1.0f,
6209 0.0f, 0.0f, 0.5f, 1.0f,
6210 0.0f, 0.5f, 0.0f, 1.0f,
6211 0.0f, 0.5f, 0.0f, 1.0f,
6212 0.5f, 0.0f, 0.0f, 1.0f,
6213 0.5f, 0.0f, 0.0f, 1.0f
6222 RSurf_ActiveCustomEntity(&ent->
matrix, &ent->
inversematrix, ent->
flags, ent->
shadertime, ent->
colormod[0], ent->
colormod[1], ent->
colormod[2], ent->
alpha, 6,
nomodelvertex3f,
NULL,
NULL,
NULL,
NULL,
nomodelcolor4f, 8,
nomodelelement3i,
nomodelelement3s,
false,
false);
6232 else if (ent->
alpha < 1)
6247 for (
i = 0, c = color4f;
i < 6;
i++, c += 4)
6256 for (
i = 0, c = color4f;
i < 6;
i++, c += 4)
6356 for (
i = 0;
i < numvertices - 2;
i++, vertex3f += 3)
6377 for (
i = 0;
i < numvertices - 2;
i++,
vertex3d += 3)
6391#define R_MESH_PLANE_DIST_EPSILON (1.0 / 32.0)
6402 for (
w = 0;
w < numplanes;
w++)
6406 for (planenum = 0, plane = planes;planenum < numplanes;planenum++, plane++)
6415 PolygonD_Divide(
tempnumpoints,
temppoints[
w],
plane2->normal[0],
plane2->normal[1],
plane2->normal[2],
plane2->dist,
R_MESH_PLANE_DIST_EPSILON, 0,
NULL,
NULL, 256,
temppoints[!
w], &
tempnumpoints,
NULL);
6427 if(parms[0] == 0 && parms[1] == 0)
6467 f = parms[0] + parms[1] *
f;
6490 if (shadertime >= 32768.0f)
6492 switch(tcmod->
tcmod)
6555 unsigned char pixels[296*194];
6561 if (!skinframe || !skinframe->
base)
6574 cache->skinframe = skinframe;
6583 float specularscale = 0.0f;
6599 if ((
unsigned int)s >= (
unsigned int)model->
numskins)
6666 for (
q = 0;
q < 3;
q++)
6685 for (
q = 0;
q < 3;
q++)
6703 for (
q = 0;
q < 3;
q++)
6722 for (
q = 0;
q < 3;
q++)
6740 for (
q = 0;
q < 3;
q++)
6765 for (
q = 0;
q < 3;
q++)
6781 for (
q = 0;
q < 3;
q++)
6916 if (specularscale != 1.0f)
6918 for (
q = 0;
q < 3;
q++)
7010 else if (wanttangents)
7032 else if (wantnormals)
7174void RSurf_ActiveCustomEntity(
const matrix4x4_t *matrix,
const matrix4x4_t *inversematrix,
int entflags,
double shadertime,
float r,
float g,
float b,
float a,
int numvertices,
const float *vertex3f,
const float *texcoord2f,
const float *normal3f,
const float *svector3f,
const float *tvector3f,
const float *color4f,
int numtriangles,
const int *element3i,
const unsigned short *element3s,
qbool wantnormals,
qbool wanttangents)
7177 if (
r != 1.0f ||
g != 1.0f ||
b != 1.0f ||
a != 1.0f) {
7183 for (
q = 0;
q < 3; ++
q) {
7184 float colormod =
q == 0 ?
r :
q == 1 ?
g :
b;
7234 else if (wantnormals)
7322 if ((wantnormals || wanttangents) && !normal3f)
7327 if (wanttangents && !svector3f)
7411 for (
i = 0;
i < numelements;
i++)
7415static const int quadedges[6][2] = {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}};
7430 int batchnumvertices;
7431 int batchnumtriangles;
7448 batchnumvertices = 0;
7449 batchnumtriangles = 0;
7776 for (
i = 0;
i < numtriangles*3;
i++)
7946 if (numvertices <= 65536)
7949 for (
i = 0;
i < numtriangles*3;
i++)
7963 const unsigned char *
si;
7964 const unsigned char *
sw;
7967 float *
vp, *
vs, *vt, *vn;
7969 float m[3][4],
n[3][4];
7970 float tp[3], ts[3],
tt[3],
tn[3];
7981 memset(m[0], 0,
sizeof(m));
7983 for (
i = 0;
i < batchnumvertices;
i++)
7985 t[0] =
b +
si[0]*12;
8002 else if (
sw[2] +
sw[3])
8005 t[1] =
b +
si[1]*12;
8006 t[2] =
b +
si[2]*12;
8007 t[3] =
b +
si[3]*12;
8008 w[0] =
sw[0] * (1.0f / 255.0f);
8009 w[1] =
sw[1] * (1.0f / 255.0f);
8010 w[2] =
sw[2] * (1.0f / 255.0f);
8011 w[3] =
sw[3] * (1.0f / 255.0f);
8013 m[0][0] = t[0][ 0] *
w[0] + t[1][ 0] *
w[1] + t[2][ 0] *
w[2] + t[3][ 0] *
w[3];
8014 m[0][1] = t[0][ 1] *
w[0] + t[1][ 1] *
w[1] + t[2][ 1] *
w[2] + t[3][ 1] *
w[3];
8015 m[0][2] = t[0][ 2] *
w[0] + t[1][ 2] *
w[1] + t[2][ 2] *
w[2] + t[3][ 2] *
w[3];
8016 m[0][3] = t[0][ 3] *
w[0] + t[1][ 3] *
w[1] + t[2][ 3] *
w[2] + t[3][ 3] *
w[3];
8017 m[1][0] = t[0][ 4] *
w[0] + t[1][ 4] *
w[1] + t[2][ 4] *
w[2] + t[3][ 4] *
w[3];
8018 m[1][1] = t[0][ 5] *
w[0] + t[1][ 5] *
w[1] + t[2][ 5] *
w[2] + t[3][ 5] *
w[3];
8019 m[1][2] = t[0][ 6] *
w[0] + t[1][ 6] *
w[1] + t[2][ 6] *
w[2] + t[3][ 6] *
w[3];
8020 m[1][3] = t[0][ 7] *
w[0] + t[1][ 7] *
w[1] + t[2][ 7] *
w[2] + t[3][ 7] *
w[3];
8021 m[2][0] = t[0][ 8] *
w[0] + t[1][ 8] *
w[1] + t[2][ 8] *
w[2] + t[3][ 8] *
w[3];
8022 m[2][1] = t[0][ 9] *
w[0] + t[1][ 9] *
w[1] + t[2][ 9] *
w[2] + t[3][ 9] *
w[3];
8023 m[2][2] = t[0][10] *
w[0] + t[1][10] *
w[1] + t[2][10] *
w[2] + t[3][10] *
w[3];
8024 m[2][3] = t[0][11] *
w[0] + t[1][11] *
w[1] + t[2][11] *
w[2] + t[3][11] *
w[3];
8029 t[1] =
b +
si[1]*12;
8030 w[0] =
sw[0] * (1.0f / 255.0f);
8031 w[1] =
sw[1] * (1.0f / 255.0f);
8033 m[0][0] = t[0][ 0] *
w[0] + t[1][ 0] *
w[1];
8034 m[0][1] = t[0][ 1] *
w[0] + t[1][ 1] *
w[1];
8035 m[0][2] = t[0][ 2] *
w[0] + t[1][ 2] *
w[1];
8036 m[0][3] = t[0][ 3] *
w[0] + t[1][ 3] *
w[1];
8037 m[1][0] = t[0][ 4] *
w[0] + t[1][ 4] *
w[1];
8038 m[1][1] = t[0][ 5] *
w[0] + t[1][ 5] *
w[1];
8039 m[1][2] = t[0][ 6] *
w[0] + t[1][ 6] *
w[1];
8040 m[1][3] = t[0][ 7] *
w[0] + t[1][ 7] *
w[1];
8041 m[2][0] = t[0][ 8] *
w[0] + t[1][ 8] *
w[1];
8042 m[2][1] = t[0][ 9] *
w[0] + t[1][ 9] *
w[1];
8043 m[2][2] = t[0][10] *
w[0] + t[1][10] *
w[1];
8044 m[2][3] = t[0][11] *
w[0] + t[1][11] *
w[1];
8050 vp[0] =
tp[0] * m[0][0] +
tp[1] * m[0][1] +
tp[2] * m[0][2] + m[0][3];
8051 vp[1] =
tp[0] * m[1][0] +
tp[1] * m[1][1] +
tp[2] * m[1][2] + m[1][3];
8052 vp[2] =
tp[0] * m[2][0] +
tp[1] * m[2][1] +
tp[2] * m[2][2] + m[2][3];
8061 vn[0] =
tn[0] *
n[0][0] +
tn[1] *
n[0][1] +
tn[2] *
n[0][2];
8062 vn[1] =
tn[0] *
n[1][0] +
tn[1] *
n[1][1] +
tn[2] *
n[1][2];
8063 vn[2] =
tn[0] *
n[2][0] +
tn[1] *
n[2][1] +
tn[2] *
n[2][2];
8069 vs[0] = ts[0] *
n[0][0] + ts[1] *
n[0][1] + ts[2] *
n[0][2];
8070 vs[1] = ts[0] *
n[1][0] + ts[1] *
n[1][1] + ts[2] *
n[1][2];
8071 vs[2] = ts[0] *
n[2][0] + ts[1] *
n[2][1] + ts[2] *
n[2][2];
8075 vt[0] =
tt[0] *
n[0][0] +
tt[1] *
n[0][1] +
tt[2] *
n[0][2];
8076 vt[1] =
tt[0] *
n[1][0] +
tt[1] *
n[1][1] +
tt[2] *
n[1][2];
8077 vt[2] =
tt[0] *
n[2][0] +
tt[1] *
n[2][1] +
tt[2] *
n[2][2];
8096 const unsigned char *
lm;
8106 if (
surface->lightmapinfo->samples)
8113 if (
surface->lightmapinfo->styles[1] != 255)
8115 size3 = ((
surface->lightmapinfo->extents[0]>>4)+1)*((
surface->lightmapinfo->extents[1]>>4)+1)*3;
8119 if (
surface->lightmapinfo->styles[2] != 255)
8124 if (
surface->lightmapinfo->styles[3] != 255)
8195 for (
j = 0;
j < batchnumvertices - 3;
j += 4)
8198 for (
i = 0;
i < 4;
i++)
8204 for (
i = 0;
i < 4;
i++)
8207 VectorMAMAMAM(1, center,
DotProduct(
forward,
v),
newforward,
DotProduct(
right,
v),
newright,
DotProduct(
up,
v),
newup,
rsurface.
batchvertex3f + 3*(
j+
i));
8225 const float *
v1, *
v2;
8237 for (
j = 0;
j < batchnumvertices - 3;
j += 4)
8240 for (
i = 0;
i < 4;
i++)
8245 for (
i = 0;
i < 6;
i++)
8252 l += (1.0f / 1024.0f);
8294 for (
i = 0;
i < 4;
i++)
8325 for (
j = 0;
j < batchnumvertices;
j++)
8363 for (
j = 0;
j < batchnumvertices;
j++)
8394 for (
j = 0;
j < batchnumvertices;
j++)
8421 for (
j = 0;
j < batchnumvertices;
j++)
8446 for (
j = 0;
j < batchnumvertices;
j++)
8457 for (
j = 0;
j < batchnumvertices;
j++)
8496 for (
j = 0;
j < batchnumvertices;
j++)
8543 for (
i = 0;
i < numsurfaces;)
8546 for (
k =
i,
j =
i + 1;
j < numsurfaces;
k =
j,
j++)
8547 if (surfacelist[
j] != surfacelist[
k] + 1)
8619 float p[3], mins[3], maxs[3];
8638 if (mins[0] > p[0]) mins[0] = p[0];
8639 if (mins[1] > p[1]) mins[1] = p[1];
8640 if (mins[2] > p[2]) mins[2] = p[2];
8641 if (maxs[0] < p[0]) maxs[0] = p[0];
8642 if (maxs[1] < p[1]) maxs[1] = p[1];
8643 if (maxs[2] < p[2]) maxs[2] = p[2];
8892 for (
i = 0;
i < numsurfaces;
i =
j)
8935 for (
i = 0;
i < numsurfaces;
i =
j)
9046 for (
i = 0;
i < numsurfaces;
i =
j)
9088 1,0,1, 1,0,0, 1,1,0, 1,1,1,
9089 0,1,1, 0,1,0, 0,0,0, 0,0,1,
9090 1,1,1, 1,1,0, 0,1,0, 0,1,1,
9091 0,0,1, 0,0,0, 1,0,0, 1,0,1,
9092 0,0,1, 1,0,1, 1,1,1, 0,1,1,
9093 1,0,0, 0,0,0, 0,1,0, 1,1,0
9111 float vertex3f[6*4*3];
9127 surfacelist[0] < 0 ? 0.5f : 0.125f);
9140 for (
i = 0;
i < 6*4*3;)
9141 for (
j = 0;
j < 3;
j++,
i++)
9166 memset(decalsystem, 0,
sizeof(*decalsystem));
9169static void R_DecalSystem_SpawnTriangle(
decalsystem_t *decalsystem,
const float *
v0,
const float *
v1,
const float *
v2,
const float *
t0,
const float *t1,
const float *t2,
const float *
c0,
const float *
c1,
const float *
c2,
int triangleindex,
int surfaceindex,
unsigned int decalsequence)
9200 decals = decalsystem->
decals;
9210 decal->triangleindex = triangleindex;
9211 decal->surfaceindex = surfaceindex;
9212 decal->decalsequence = decalsequence;
9216 decal->color4f[0][3] = 1;
9220 decal->color4f[1][3] = 1;
9224 decal->color4f[2][3] = 1;
9225 decal->vertex3f[0][0] =
v0[0];
9226 decal->vertex3f[0][1] =
v0[1];
9227 decal->vertex3f[0][2] =
v0[2];
9228 decal->vertex3f[1][0] =
v1[0];
9229 decal->vertex3f[1][1] =
v1[1];
9230 decal->vertex3f[1][2] =
v1[2];
9231 decal->vertex3f[2][0] =
v2[0];
9232 decal->vertex3f[2][1] =
v2[1];
9233 decal->vertex3f[2][2] =
v2[2];
9234 decal->texcoord2f[0][0] =
t0[0];
9235 decal->texcoord2f[0][1] =
t0[1];
9236 decal->texcoord2f[1][0] = t1[0];
9237 decal->texcoord2f[1][1] = t1[1];
9238 decal->texcoord2f[2][0] = t2[0];
9239 decal->texcoord2f[2][1] = t2[1];
9249static void R_DecalSystem_SplatTriangle(
decalsystem_t *decalsystem,
float r,
float g,
float b,
float a,
float s1,
float t1,
float s2,
float t2,
unsigned int decalsequence,
qbool dynamic,
float (*planes)[4],
matrix4x4_t *
projection,
int triangleindex,
int surfaceindex)
9254 const float *vertex3f;
9255 const float *normal3f;
9257 float points[2][9][3];
9292 numpoints =
PolygonF_Clip(3 ,
v[0] , planes[0][0], planes[0][1], planes[0][2], planes[0][3], 1.0f/64.0f,
sizeof(points[0])/
sizeof(points[0][0]), points[1][0]);
9295 numpoints =
PolygonF_Clip(numpoints, points[1][0], planes[1][0], planes[1][1], planes[1][2], planes[1][3], 1.0f/64.0f,
sizeof(points[0])/
sizeof(points[0][0]), points[0][0]);
9298 numpoints =
PolygonF_Clip(numpoints, points[0][0], planes[2][0], planes[2][1], planes[2][2], planes[2][3], 1.0f/64.0f,
sizeof(points[0])/
sizeof(points[0][0]), points[1][0]);
9301 numpoints =
PolygonF_Clip(numpoints, points[1][0], planes[3][0], planes[3][1], planes[3][2], planes[3][3], 1.0f/64.0f,
sizeof(points[0])/
sizeof(points[0][0]), points[0][0]);
9304 numpoints =
PolygonF_Clip(numpoints, points[0][0], planes[4][0], planes[4][1], planes[4][2], planes[4][3], 1.0f/64.0f,
sizeof(points[0])/
sizeof(points[0][0]), points[1][0]);
9307 numpoints =
PolygonF_Clip(numpoints, points[1][0], planes[5][0], planes[5][1], planes[5][2], planes[5][3], 1.0f/64.0f,
sizeof(points[0])/
sizeof(points[0][0]),
v[0]);
9337 R_DecalSystem_SpawnTriangle(decalsystem,
v[0],
v[1],
v[2],
tc[0],
tc[1],
tc[2], c[0], c[1], c[2], triangleindex, surfaceindex, decalsequence);
9340 R_DecalSystem_SpawnTriangle(decalsystem,
v[0],
v[
cornerindex+1],
v[
cornerindex+2],
tc[0],
tc[
cornerindex+1],
tc[
cornerindex+2], c[0], c[
cornerindex+1], c[
cornerindex+2], -1, surfaceindex, decalsequence);
9342static void R_DecalSystem_SplatEntity(
entity_render_t *ent,
const vec3_t worldorigin,
const vec3_t worldnormal,
float r,
float g,
float b,
float a,
float s1,
float t1,
float s2,
float t2,
float worldsize,
unsigned int decalsequence)
9377 if (decalsystem->
model)
9382 if (decalsystem->
model != model)
9384 decalsystem->
model = model;
9474 R_DecalSystem_SplatTriangle(decalsystem,
r,
g,
b,
a, s1, t1, s2, t2, decalsequence,
dynamic, planes, &
projection,
bih_triangles[triangleindex], surfaceindex);
9493 numtriangles =
surface->num_triangles;
9494 for (triangleindex = 0; triangleindex < numtriangles; triangleindex++)
9495 R_DecalSystem_SplatTriangle(decalsystem,
r,
g,
b,
a, s1, t1, s2, t2, decalsequence,
dynamic, planes, &
projection, triangleindex +
surface->num_firsttriangle, surfaceindex);
9501static void R_DecalSystem_ApplySplatEntities(
const vec3_t worldorigin,
const vec3_t worldnormal,
float r,
float g,
float b,
float a,
float s1,
float t1,
float s2,
float t2,
float worldsize,
unsigned int decalsequence)
9508 worldmins[0] = worldorigin[0] - worldsize;
9509 worldmins[1] = worldorigin[1] - worldsize;
9510 worldmins[2] = worldorigin[2] - worldsize;
9511 worldmaxs[0] = worldorigin[0] + worldsize;
9512 worldmaxs[1] = worldorigin[1] + worldsize;
9513 worldmaxs[2] = worldorigin[2] + worldsize;
9515 R_DecalSystem_SplatEntity(
r_refdef.
scene.
worldentity, worldorigin, worldnormal,
r,
g,
b,
a, s1, t1, s2, t2, worldsize, decalsequence);
9523 R_DecalSystem_SplatEntity(ent, worldorigin, worldnormal,
r,
g,
b,
a, s1, t1, s2, t2, worldsize, decalsequence);
9541void R_DecalSystem_SplatEntities(
const vec3_t worldorigin,
const vec3_t worldnormal,
float r,
float g,
float b,
float a,
float s1,
float t1,
float s2,
float t2,
float worldsize)
9563 R_DecalSystem_ApplySplatEntities(queue->
worldorigin, queue->
worldnormal, queue->
color[0], queue->
color[1], queue->
color[2], queue->
color[3], queue->
tcrange[0], queue->
tcrange[1], queue->
tcrange[2], queue->
tcrange[3], queue->
worldsize, queue->
decalsequence);
9602 if (
decal->color4f[0][3])
9604 decal->lived += frametime;
9614 while (numdecals > 0 && !
decal[numdecals-1].color4f[0][3])
9622 if (decalsystem->
freedecal == numdecals)
9680 if (!
decal->color4f[0][3])
9753 RSurf_ActiveCustomEntity(&
rsurface.
matrix, &
rsurface.
inversematrix,
rsurface.
ent_flags, ent->
shadertime, 1, 1, 1, 1, numdecals*3, decalsystem->
vertex3f, decalsystem->
texcoord2f,
NULL,
NULL,
NULL, decalsystem->
color4f, numtris, decalsystem->
element3i, decalsystem->
element3s,
false,
false);
9862 float vertex3f[3][3];
9880 triangleindex =
bihleaf->itemindex;
9889 triangleindex =
bihleaf->itemindex;
10169 float r1 = 1.0f,
g1 = 0.0f,
b1 = 0.0f,
alpha1 = 0.25f;
10170 float r2 = 1.0f,
g2 = 1.0f,
b2 = 0.0f,
alpha2 = 0.25f;
10174 Vector4Set(
w[0], start[0], start[1], start[2], 1);
10198 e0 =
Mod_Mesh_IndexForVertex(mod,
surf,
x1 -
offsetx,
y1 -
offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r1,
g1,
b1,
alpha1);
10199 e1 =
Mod_Mesh_IndexForVertex(mod,
surf,
x2 -
offsetx,
y2 -
offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r2,
g2,
b2,
alpha2);
10200 e2 =
Mod_Mesh_IndexForVertex(mod,
surf,
x2 +
offsetx,
y2 +
offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r2,
g2,
b2,
alpha2);
10201 e3 =
Mod_Mesh_IndexForVertex(mod,
surf,
x1 +
offsetx,
y1 +
offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r1,
g1,
b1,
alpha1);
10217 texture.currentskinframe = skinframe;
10221 texture.specularscalemod = 1;
10222 texture.specularpowermod = 1;
10235 surface.num_triangles = numtriangles;
10237 surface.num_vertices = numvertices;
10238 surface.num_firstvertex = firstvertex;
int BIH_GetTriangleListForBox(const bih_t *bih, int maxtriangles, int *trianglelist_idx, int *trianglelist_surf, const float *mins, const float *maxs)
#define SUPERCONTENTS_SKY
#define SUPERCONTENTS_SOLID
trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities, qbool hitsurfaces)
trace_t CL_Cache_TraceLineSurfaces(const vec3_t start, const vec3_t end, int type, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
cl_locnode_t * CL_Locs_FindNearest(const vec3_t point)
void CL_MeshEntities_Init(void)
entity_t cl_meshentities[NUM_MESHENTITIES]
void CL_ParseEntityLump(char *entdata)
void R_DrawParticles(void)
cvar_t cl_decals_fadetime
void R_Particles_Init(void)
qbool R_Stereo_ColorMasking(void)
void R_ClearScreen(qbool fogcolor)
qbool R_Stereo_Active(void)
cvar_t r_stereo_separation
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
cmd_state_t * cmd_local
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses...
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
void Collision_Cache_Reset(qbool resetlimits)
unsigned short CRC_Block(const unsigned char *data, size_t size)
char * va(char *buf, size_t buflen, const char *format,...)
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
#define dp_strlcat(dst, src, dsize)
#define dp_strlcpy(dst, src, dsize)
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
qbool CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clipplane, vec3_t visorigin)
void Cvar_SetValueQuick(cvar_t *var, float value)
void Cvar_SetValue(cvar_state_t *cvars, const char *var_name, float value)
expands value to a string and calls Cvar_Set
void Cvar_Set(cvar_state_t *cvars, const char *var_name, const char *value)
equivelant to "<name> <variable>" typed at the console
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
float noise4f(float x, float y, float z, float w)
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
qfile_t * FS_OpenRealFile(const char *filepath, const char *mode, qbool quiet)
static int(ZEXPORT *qz_inflate)(z_stream *strm
int FS_Close(qfile_t *file)
int FS_Print(qfile_t *file, const char *msg)
void R_Mesh_PrepareVertices_Vertex3f(int numvertices, const float *vertex3f, const r_meshbuffer_t *vertexbuffer, int bufferoffset)
float gl_modelviewprojection16f[16]
matrix4x4_t gl_modelmatrix
void GL_Clear(int mask, const float *colorvalue, float depthvalue, int stencilvalue)
void R_Mesh_VertexPointer(int components, int gltype, size_t stride, const void *pointer, const r_meshbuffer_t *vertexbuffer, size_t bufferoffset)
void R_Mesh_CopyToTexture(rtexture_t *tex, int tx, int ty, int sx, int sy, int width, int height)
void GL_CullFace(int state)
void GL_ColorMask(int r, int g, int b, int a)
unsigned short polygonelement3s[(POLYGONELEMENTS_MAXPOINTS-2) *3]
void R_Mesh_TexCoordPointer(unsigned int unitnum, int components, int gltype, size_t stride, const void *pointer, const r_meshbuffer_t *vertexbuffer, size_t bufferoffset)
void GL_DepthMask(int state)
void GL_Backend_FreeProgram(unsigned int prog)
matrix4x4_t gl_modelviewprojectionmatrix
int polygonelement3i[(POLYGONELEMENTS_MAXPOINTS-2) *3]
void R_Mesh_TexBind(unsigned int unitnum, rtexture_t *tex)
void R_Mesh_ColorPointer(int components, int gltype, size_t stride, const void *pointer, const r_meshbuffer_t *vertexbuffer, size_t bufferoffset)
void GL_DepthFunc(int state)
void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtriangles, const int *element3i, const r_meshbuffer_t *element3i_indexbuffer, int element3i_bufferoffset, const unsigned short *element3s, const r_meshbuffer_t *element3s_indexbuffer, int element3s_bufferoffset)
void R_Viewport_TransformToScreen(const r_viewport_t *v, const vec4_t in, vec4_t out)
void R_Viewport_InitPerspective(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float frustumx, float frustumy, float nearclip, float farclip, const float *nearplane)
void GL_DepthTest(int state)
void GL_DepthRange(float nearfrac, float farfrac)
void R_Viewport_InitOrtho3D(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float frustumx, float frustumy, float nearclip, float farclip, const float *nearplane)
void GL_PolygonOffset(float planeoffset, float depthoffset)
r_meshbuffer_t * R_Mesh_CreateMeshBuffer(const void *data, size_t size, const char *name, qbool isindexbuffer, qbool isuniformbuffer, qbool isdynamic, qbool isindex16)
int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colortexture, rtexture_t *colortexture2, rtexture_t *colortexture3, rtexture_t *colortexture4)
void R_SetViewport(const r_viewport_t *v)
void R_Viewport_InitOrtho(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float x1, float y1, float x2, float y2, float nearclip, float farclip, const float *nearplane)
matrix4x4_t gl_modelviewmatrix
void R_Mesh_DestroyMeshBuffer(r_meshbuffer_t *buffer)
void R_Mesh_ResetTextureState(void)
matrix4x4_t gl_projectionmatrix
void GL_Color(float cr, float cg, float cb, float ca)
void R_Mesh_SetRenderTargets(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, rtexture_t *colortexture2, rtexture_t *colortexture3, rtexture_t *colortexture4)
void R_Mesh_PrepareVertices_Mesh_Arrays(int numvertices, const float *vertex3f, const float *svector3f, const float *tvector3f, const float *normal3f, const float *color4f, const float *texcoordtexture2f, const float *texcoordlightmap2f)
void GL_BlendFunc(int blendfunc1, int blendfunc2)
qbool R_ScissorForBBox(const float *mins, const float *maxs, int *scissor)
void R_Viewport_InitPerspectiveInfinite(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float frustumx, float frustumy, float nearclip, const float *nearplane)
void GL_AlphaToCoverage(qbool state)
void GL_Scissor(int x, int y, int width, int height)
float gl_modelview16f[16]
void R_Mesh_PrepareVertices_Generic_Arrays(int numvertices, const float *vertex3f, const float *color4f, const float *texcoord2f)
qbool gl_modelmatrixchanged
void R_Mesh_UpdateMeshBuffer(r_meshbuffer_t *buffer, const void *data, size_t size, qbool subdata, size_t offset)
matrix4x4_t gl_viewmatrix
void R_Mesh_DestroyFramebufferObject(int fbo)
void GL_ScissorTest(int state)
void gl_backend_init(void)
unsigned int GL_Backend_CompileProgram(int vertexstrings_count, const char **vertexstrings_list, int geometrystrings_count, const char **geometrystrings_list, int fragmentstrings_count, const char **fragmentstrings_list)
static const int nomodelelement3i[24]
rtexture_t * r_texture_whitecube
static void R_DecalSystem_ApplySplatEntitiesQueue(void)
void R_FrameData_SetMark(void)
set a marker that allows you to discard the following temporary memory allocations
static int R_DrawBrushModelsSky(void)
only used if skyrendermasked, and normally returns false
void R_Mesh_AddPolygon3f(rmesh_t *mesh, int numvertices, float *vertex3f)
cvar_t r_shadows_castfrombmodels
@ SHADERSTATICPARM_POSTPROCESS_USERVEC4
postprocess uservec4 is enabled
@ SHADERSTATICPARM_SHADOWSAMPLER
sampler
@ SHADERSTATICPARM_EXACTSPECULARMATH
(lightsource or deluxemapping) use exact reflection map for specular effects, as opposed to the usual...
@ SHADERSTATICPARM_CELOUTLINES
celoutline (depth buffer analysis to produce outlines)
@ SHADERSTATICPARM_VERTEXTEXTUREBLEND_USEBOTHALPHAS
@ SHADERSTATICPARM_SHADOWMAPPCF_1
PCF 1.
@ SHADERSTATICPARM_CELSHADING
celshading (alternative diffuse and specular math)
@ SHADERSTATICPARM_COLORFRINGE
colorfringe (chromatic aberration)
@ SHADERSTATICPARM_POSTPROCESS_USERVEC2
postprocess uservec2 is enabled
@ SHADERSTATICPARM_OFFSETMAPPING_USELOD
LOD for offsetmapping.
@ SHADERSTATICPARM_FXAA
fast approximate anti aliasing
@ SHADERSTATICPARM_POSTPROCESS_USERVEC1
postprocess uservec1 is enabled
@ SHADERSTATICPARM_SATURATION_REDCOMPENSATE
red compensation filter for saturation
@ SHADERSTATICPARM_SHADOWMAPPCF_2
PCF 2.
@ SHADERSTATICPARM_POSTPROCESS_USERVEC3
postprocess uservec3 is enabled
cvar_t r_buffermegs[R_BUFFERDATA_COUNT]
cvar_t r_shadows_shadowmapbias
void R_GLSL_Restart_f(cmd_state_t *cmd)
unsigned short locboxelements[6 *2 *3]
void R_SetupShader_Generic_NoTexture(qbool usegamma, qbool notrippy)
rtexturepool_t * r_main_texturepool
static void R_LoadQWSkin(r_qwskincache_t *cache, const char *skinname)
static const float nomodelvertex3f[6 *3]
cvar_t r_motionblur_velocityfactor
void R_RenderView(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, int x, int y, int width, int height)
static void R_Main_FreeViewCache(void)
qbool R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t entboxexpand, vec_t pad, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs)
skinframe_t * R_SkinFrame_LoadInternalQuake(const char *name, int textureflags, int loadpantsandshirt, int loadglowtexture, const unsigned char *skindata, int width, int height)
void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const msurface_t **texturesurfacelist)
int r_decalsystem_numqueued
void R_ResetViewRendering2D(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
static void R_BuildWhiteCube(void)
static void R_DrawModelDecals_Entity(entity_render_t *ent)
r_rendertarget_t * R_RenderTarget_Get(int texturewidth, int textureheight, textype_t depthtextype, qbool depthisrenderbuffer, textype_t colortextype0, textype_t colortextype1, textype_t colortextype2, textype_t colortextype3)
#define BLENDFUNC_ALLOWS_FOG_HACK0
cvar_t r_motionblur_minblur
cvar_t r_shadows_drawafterrtlighting
static void R_DrawEntityBBoxes_Callback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
void R_RenderView_UpdateViewVectors(void)
static void R_BlendView(rtexture_t *viewcolortexture, int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, int x, int y, int width, int height)
void R_EntityMatrix(const matrix4x4_t *matrix)
void R_FrameData_ReturnToMark(void)
discard recent memory allocations (rewind to marker)
cvar_t r_water_hideplayer
void R_FrameData_Reset(void)
free all R_FrameData memory
skinframe_t * R_SkinFrame_LoadInternalUsingTexture(const char *name, int textureflags, rtexture_t *tex, int width, int height, qbool sRGB)
int r_shadow_shadowmappcf
cvar_t r_hdr_irisadaptation_fade_up
cvar_t r_glsl_offsetmapping_reliefmapping_steps
cvar_t r_q1bsp_lightmap_updates_enabled
static void R_DrawLoc_Callback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
#define R_MESH_PLANE_DIST_EPSILON
void R_DecalSystem_Reset(decalsystem_t *decalsystem)
cvar_t r_batch_dynamicbuffer
#define R_BUFFERDATA_CYCLE
cvar_t r_hdr_irisadaptation_value
cvar_t r_hdr_irisadaptation_minvalue
static void R_SortEntities(void)
unsigned int r_maxqueries
cvar_t r_hdr_irisadaptation_fade_down
float RSurf_FogVertex(const float *v)
rtexture_t * r_texture_grey128
memexpandablearray_t r_glsl_permutationarray
storage for permutations linked in the hash table
#define R_COMPILESHADER_STATICPARM_ENABLE(p)
rtexture_t * r_shadow_prepasslightingdiffusetexture
void R_SetupShader_DepthOrShadow(qbool notrippy, qbool depthrgb, qbool skeletal)
cvar_t r_bloom_colorsubtract
rtexture_t * r_texture_fogattenuation
skinframe_t * decalskinframe
cvar_t r_viewscale_fpsscaling_stepsize
static char * R_ShaderStrCat(const char **strings)
static qbool r_gpuskeletal
cvar_t r_fullbright_directed_pitch_relative
cvar_t r_usedepthtextures
cvar_t r_bloom_colorexponent
cvar_t r_glsl_postprocess_uservec1_enable
void R_RenderScene(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
cvar_t r_water_clippingplanebias
qbool R_AnimCache_GetEntity(entity_render_t *ent, qbool wantnormals, qbool wanttangents)
get the skeletal data or cached animated mesh data for an entity (optionally with normals and tangent...
r_skinframe_t r_skinframe
static void R_DrawModelsDebug(void)
static void R_CalcTexCoordsForView(float x, float y, float w, float h, float tw, float th, float *texcoord2f)
shadermodeinfo_t shadermodeinfo[SHADERLANGUAGE_COUNT][SHADERMODE_COUNT]
static rtexture_t * R_LoadCubemap(const char *basename)
cvar_t r_q1bsp_skymasking
rtexture_t * r_shadow_prepasslightingspeculartexture
cvar_t r_transparent_sortmaxdist
void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qbool writedepth, qbool prepass, qbool ui)
cvar_t r_smoothnormals_areaweighting
static void R_SkinFrame_GenerateTexturesFromQPixels(skinframe_t *skinframe, qbool colormapped)
void R_SkinFrame_PrepareForPurge(void)
cvar_t r_fullbright_directed_diffuse
void R_SetupShader_Generic(rtexture_t *t, qbool usegamma, qbool notrippy, qbool suppresstexalpha)
cvar_t r_shadows_throwdirection
cvar_t r_transparent_useplanardistance
rtexture_t * r_texture_black
void RSurf_DrawBatch(void)
static r_qwskincache_t * r_qwskincache
cvar_t r_motionblur_velocityfactor_minspeed
int r_textureframe
used only by R_GetCurrentTexture, incremented per view and per UI render
cvar_t r_glsl_deluxemapping
static void gl_main_start(void)
static r_bufferdata_buffer_t * r_bufferdata_buffer[R_BUFFERDATA_CYCLE][R_BUFFERDATA_COUNT]
cvar_t r_q1bsp_lightmap_updates_hidden_surfaces
static void R_DecalSystem_SpawnTriangle(decalsystem_t *decalsystem, const float *v0, const float *v1, const float *v2, const float *t0, const float *t1, const float *t2, const float *c0, const float *c1, const float *c2, int triangleindex, int surfaceindex, unsigned int decalsequence)
static void R_DrawModelTextureSurfaceList(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth, qbool prepass, qbool ui)
static void R_BuildBlankTextures(void)
void R_RenderWaterPlanes(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
static void R_DrawModelsAddWaterPlanes(void)
r_refdef_scene_t * R_GetScenePointer(r_refdef_scene_type_t scenetype)
#define BLENDFUNC_ALLOWS_FOG_HACKALPHA
r_glsl_permutation_t * r_glsl_permutation
currently selected permutation
float viewscalefpsadjusted
int r_texture_numcubemaps
void R_FillColors(float *out, int verts, float r, float g, float b, float a)
void R_Mesh_AddBrushMeshFromPlanes(rmesh_t *mesh, int numplanes, mplane_t *planes)
cvar_t r_viewscale_fpsscaling_stepmax
void R_BufferData_NewFrame(void)
begin a new frame (recycle old buffers)
static void R_DrawNoModel_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
qbool r_shadow_usingdeferredprepass
static void R_DrawTextureSurfaceList_GL20(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth, qbool prepass, qbool ui)
void R_ResetViewRendering3D(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
cvar_t r_showcollisionbrushes_polygonfactor
static qbool R_BlendView_IsTrivial(int viewwidth, int viewheight, int width, int height)
static void R_DrawLocs(void)
static void R_Bloom_StartFrame(void)
cvar_t r_motionblur_velocityfactor_maxspeed
float RSurf_FogPoint(const float *v)
cvar_t r_cullentities_trace
static void R_DecalSystem_SplatTriangle(decalsystem_t *decalsystem, float r, float g, float b, float a, float s1, float t1, float s2, float t2, unsigned int decalsequence, qbool dynamic, float(*planes)[4], matrix4x4_t *projection, int triangleindex, int surfaceindex)
cvar_t r_water_scissormode
cvar_t r_polygonoffset_decals_factor
skinframe_t * R_SkinFrame_LoadExternal(const char *name, int textureflags, qbool complain, qbool fallbacknotexture)
cvar_t r_hdr_irisadaptation_maxvalue
cvar_t r_viewscale_fpsscaling_target
const float r_screenvertex3f[12]
vertex coordinates for a quad that covers the screen exactly
void V_MakeViewIsometric(void)
rtexture_t * r_texture_notexture
static void R_BufferData_Resize(r_bufferdata_type_t type, qbool mustgrow, size_t minsize)
cvar_t r_viewscale_fpsscaling_min
static void RSurf_RenumberElements(const int *inelement3i, int *outelement3i, int numelements, int adjust)
void R_HDR_UpdateIrisAdaptation(const vec3_t point)
r_framebufferstate_t r_fb
cvar_t r_water_resolutionmultiplier
skinframe_t * R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height, int comparewidth, int compareheight, int comparecrc, qbool sRGB)
float locboxvertex3f[6 *4 *3]
matrix4x4_t r_waterscrollmatrix
static void R_FrameData_Resize(qbool mustgrow)
cvar_t r_glsl_offsetmapping_reliefmapping_refinesteps
qbool r_shadow_shadowmapsampler
static void R_BuildNormalizationCube(void)
rtexture_t * r_texture_reflectcube
cvar_t r_water_refractdistort
static void R_MotionBlurView(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
static float irisvecs[7][3]
void R_SetupShader_DeferredLight(const rtlight_t *rtlight)
void R_UpdateVariables(void)
void * R_FrameData_Alloc(size_t size)
allocate some temporary memory for your purposes
static int RSurf_FindWaterPlaneForSurface(const msurface_t *surface)
cvar_t r_glsl_vertextextureblend_usebothalphas
skinframe_t * R_SkinFrame_Find(const char *name, int textureflags, int comparewidth, int compareheight, int comparecrc, qbool add)
void R_RenderTarget_FreeUnused(qbool force)
static const unsigned short bboxelements[36]
r_decalsystem_splatqueue_t r_decalsystem_queue[MAX_DECALSYSTEM_QUEUE]
cvar_t r_cullentities_trace_eyejitter
static void R_SetupShader_SetPermutationGLSL(unsigned int mode, uint64_t permutation)
skinframe_t * R_SkinFrame_LoadNoTexture(void)
cvar_t r_glsl_postprocess_uservec3_enable
static void R_GLSL_CompilePermutation(r_glsl_permutation_t *p, unsigned int mode, uint64_t permutation)
unsigned int r_texture_gammaramps_serial
cvar_t r_polygonoffset_decals_offset
static void gl_main_newmap(void)
cvar_t r_bloom_scenebrightness
static const float bboxedges[BBOXEDGES][6]
void R_Water_AddWaterPlane(msurface_t *surface, int entno)
static void R_View_Update(const int *myscissor)
void R_SkinFrame_Purge(void)
mempool_t * r_main_mempool
static void R_View_UpdateEntityVisible(void)
cvar_t r_bloom_colorscale
unsigned int r_numqueries
cvar_t r_motionblur_mousefactor
rtexture_t * r_texture_blanknormalmap
cvar_t r_transparent_sortsurfacesbynearest
static char * ShaderModeInfo_GetShaderText(shadermodeinfo_t *modeinfo, qbool printfromdisknotice, qbool builtinonly)
texture_t * R_GetCurrentTexture(texture_t *t)
static const char * shaderstaticparmstrings_list[SHADERSTATICPARMS_COUNT]
cvar_t r_glsl_offsetmapping
cvar_t r_batch_multidraw_mintriangles
rtexture_t * r_texture_fogheighttexture
void R_AnimCache_Free(void)
Animation cache prevents re-generating mesh data for an animated model multiple times in one frame fo...
void R_SelectScene(r_refdef_scene_type_t scenetype)
static void R_ProcessModelTextureSurfaceList(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth, qbool depthonly, qbool prepass, qbool ui)
static void R_DrawModels(void)
cvar_t r_water_lowquality
static void R_DrawModelDecals_FadeEntity(entity_render_t *ent)
cvar_t r_cullentities_trace_tempentitysamples
cvar_t r_cullentities_trace_delay
static const unsigned short nomodelelement3s[24]
static void R_Bloom_MakeTexture(void)
cvar_t r_bloom_resolution
void R_ResetViewRendering2D_Common(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight, float x2, float y2)
cvar_t r_hdr_irisadaptation
void RSurf_SetupDepthAndCulling(bool ui)
static void R_View_SetFrustum(const int *scissor)
svbsp_t r_svbsp
shadow volume bsp struct with automatically growing nodes buffer
static void R_GetCornerOfBox(vec3_t out, const vec3_t mins, const vec3_t maxs, int signbits)
static void R_tcMod_ApplyToMatrix(matrix4x4_t *texmatrix, q3shaderinfo_layer_tcmod_t *tcmod, int currentmaterialflags)
cvar_t r_fullbright_directed
cvar_t r_useinfinitefarclip
cvar_t r_shadows_shadowmapscale
static void R_DrawTextureSurfaceList_Sky(int texturenumsurfaces, const msurface_t **texturesurfacelist)
int r_uniformbufferalignment
#define SHADERSTATICPARMS_COUNT
cvar_t r_hdr_scenebrightness
static void R_QueueModelSurfaceList(entity_render_t *ent, int numsurfaces, const msurface_t **surfacelist, int flagsmask, qbool writedepth, qbool depthonly, qbool prepass, qbool ui)
static r_refdef_scene_type_t r_currentscenetype
static void R_ProcessTransparentTextureSurfaceList(int texturenumsurfaces, const msurface_t **texturesurfacelist)
rtexture_t * R_GetCubemap(const char *basename)
qbool R_CullBox(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes)
shaderpermutationinfo_t shaderpermutationinfo[SHADERPERMUTATION_COUNT]
cvar_t r_motionblur_maxblur
cvar_t r_motionblur_averaging
cvar_t r_fullbright_directed_ambient
cvar_t r_transparent_sortarraysize
#define R_COMPILESHADER_STATICPARM_EMIT(p, n)
cvar_t r_motionblur_mousefactor_maxspeed
qbool R_CompileShader_CheckStaticParms(void)
static qbool r_loadnormalmap
static void R_DecalSystem_ApplySplatEntities(const vec3_t worldorigin, const vec3_t worldnormal, float r, float g, float b, float a, float s1, float t1, float s2, float t2, float worldsize, unsigned int decalsequence)
cvar_t r_showparticleedges
cvar_t r_fullbright_directed_pitch
cvar_t r_water_reflectdistort
skinframe_t * R_SkinFrame_FindNextByName(skinframe_t *last, const char *name)
cvar_t r_motionblur_mousefactor_minspeed
cvar_t r_hdr_irisadaptation_radius
static void R_CompileShader_AddStaticParms(unsigned int mode, uint64_t permutation)
cvar_t r_polygonoffset_submodel_factor
static void R_Water_ProcessPlanes(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, int viewx, int viewy, int viewwidth, int viewheight)
void R_AnimCache_ClearCache(void)
clear the animcache pointers on all known render entities
cvar_t r_drawexteriormodel
cubemapinfo_t * r_texture_cubemaps[MAX_CUBEMAPS]
void R_DebugLine(vec3_t start, vec3_t end)
static int componentorder[4]
static qbool _R_CullBox(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes, int ignore)
cvar_t developer_texturelogging
void R_CalcBeam_Vertex3f(float *vert, const float *org1, const float *org2, float width)
static const int quadedges[6][2]
cvar_t r_viewscale_fpsscaling_multiply
const msurface_t ** r_surfacelist
cvar_t r_glsl_offsetmapping_lod
void R_BufferData_Reset(void)
frees all dynamic buffers
void R_CalcSprite_Vertex3f(float *vertex3f, const vec3_t origin, const vec3_t left, const vec3_t up, float scalex1, float scalex2, float scaley1, float scaley2)
#define R_SKINFRAME_LOAD_AVERAGE_COLORS(cnt, getpixel)
cvar_t r_glsl_offsetmapping_scale
cvar_t r_batch_debugdynamicvertexpath
void RSurf_UploadBuffersForBatch(void)
static void R_InitShaderModeInfo(void)
void R_ModulateColors(float *in, float *out, int verts, float r, float g, float b)
static int r_bufferdata_cycle
cvar_t r_shadows_throwdistance
void R_DrawModelSurfaces(entity_render_t *ent, qbool skysurfaces, qbool writedepth, qbool depthonly, qbool debug, qbool prepass, qbool ui)
static unsigned int r_compileshader_staticparms[(SHADERSTATICPARMS_COUNT+0x1F) > > 5]
void R_SkinFrame_PurgeSkinFrame(skinframe_t *s)
cvar_t r_transparent_sortmindist
cvar_t r_cullentities_trace_samples
cvar_t r_showbboxes_client
skinframe_t * R_SkinFrame_LoadMissing(void)
cvar_t r_glsl_postprocess_uservec2_enable
void R_SetupView(qbool allowwaterclippingplane, int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
cvar_t r_showcollisionbrushes
void RSurf_ActiveModelEntity(const entity_render_t *ent, qbool wantnormals, qbool wanttangents, qbool prepass)
static void R_BuildFogTexture(void)
cvar_t r_glsl_postprocess_uservec4
static r_glsl_permutation_t * R_GLSL_FindPermutation(unsigned int mode, uint64_t permutation)
skinframe_t * R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const char *name, int textureflags, qbool complain, qbool fallbacknotexture)
int r_shadow_shadowmapatlas_modelshadows_size
cvar_t r_cullentities_trace_expand
static void R_Mesh_AddPolygon3d(rmesh_t *mesh, int numvertices, double *vertex3d)
static int shaderstaticparms_count
r_glsl_permutation_t * r_glsl_permutationhash[SHADERMODE_COUNT][SHADERPERMUTATION_HASHSIZE]
information about each possible shader permutation
cvar_t r_shadow_bouncegrid
void R_SkinFrame_MarkUsed(skinframe_t *skinframe)
void R_DecalSystem_SplatEntities(const vec3_t worldorigin, const vec3_t worldnormal, float r, float g, float b, float a, float s1, float t1, float s2, float t2, float worldsize)
cvar_t r_transparent_alphatocoverage
void R_FrameData_NewFrame(void)
prepare for a new frame, recycles old buffers if a resize occurred previously
cvar_t r_glsl_saturation_redcompensate
cvar_t r_glsl_offsetmapping_reliefmapping
cvar_t r_polygonoffset_submodel_offset
static void gl_main_shutdown(void)
#define BLENDFUNC_ALLOWS_FOG
cvar_t r_showcollisionbrushes_polygonoffset
static r_refdef_scene_t r_scenes_store[RST_COUNT]
cvar_t r_showdisabledepthtest
static void R_DrawDebugModel(void)
cvar_t r_motionblur_randomize
#define BLENDFUNC_ALLOWS_COLORMOD
void R_SetupShader_Surface(const float rtlightambient[3], const float rtlightdiffuse[3], const float rtlightspecular[3], rsurfacepass_t rsurfacepass, int texturenumsurfaces, const msurface_t **texturesurfacelist, void *surfacewaterplane, qbool notrippy, qbool ui)
static r_framedata_mem_t * r_framedata_mem
#define SHADERPERMUTATION_HASHSIZE
cvar_t r_cullentities_trace_pad
static int R_Mesh_AddVertex(rmesh_t *mesh, float x, float y, float z)
static void R_DrawSurface_TransparentCallback(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist)
cvar_t r_cullentities_trace_enlarge
static void R_BuildNoTexture(void)
static const float nomodelcolor4f[6 *4]
cvar_t r_glsl_postprocess_uservec4_enable
cvar_t r_hdr_irisadaptation_multiplier
cvar_t r_glsl_postprocess_uservec1
static qbool R_TestQ3WaveFunc(q3wavefunc_t func, const float *parms)
cvar_t r_water_cameraentitiesonly
static void R_Water_StartFrame(int viewwidth, int viewheight)
qbool R_CullFrustum(const vec3_t mins, const vec3_t maxs)
static float R_EvaluateQ3WaveFunc(q3wavefunc_t func, const float *parms)
cvar_t r_rendertarget_debug
rtexture_t * loadingscreentexture
cvar_t r_glsl_offsetmapping_steps
cvar_t r_q1bsp_lightmap_updates_combine
static void R_BuildFogHeightTexture(void)
rtexture_t * r_texture_gammaramps
static int R_SortEntities_Compare(const void *ap, const void *bp)
static void R_DrawModelDecals(void)
static void R_Main_ResizeViewCache(void)
static suffixinfo_t suffix[3][6]
cvar_t r_texture_dds_load
rtexture_t * r_texture_white
static int r_qwskincache_size
rtexture_t * r_texture_normalizationcube
static void R_GLSL_DumpShader_f(cmd_state_t *cmd)
unsigned int r_shadow_occlusion_buf
static void R_DrawModelsDepth(void)
cvar_t r_glsl_postprocess_uservec2
r_meshbuffer_t * R_BufferData_Store(size_t datasize, const void *data, r_bufferdata_type_t type, int *returnbufferoffset)
request space in a vertex/index/uniform buffer for the chosen data, returns the buffer pointer and of...
cvar_t r_glsl_postprocess
void R_DrawCustomSurface_Texture(texture_t *texture, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qbool writedepth, qbool prepass, qbool ui)
static void R_DrawBBoxMesh(vec3_t mins, vec3_t maxs, float cr, float cg, float cb, float ca)
static void R_DrawTextureSurfaceList_DepthOnly(int texturenumsurfaces, const msurface_t **texturesurfacelist)
cvar_t r_hdr_glowintensity
void * R_FrameData_Store(size_t size, void *data)
allocate some temporary memory and copy this data into it
cvar_t r_cullentities_trace_entityocclusion
void RSurf_ActiveCustomEntity(const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, int entflags, double shadertime, float r, float g, float b, float a, int numvertices, const float *vertex3f, const float *texcoord2f, const float *normal3f, const float *svector3f, const float *tvector3f, const float *color4f, int numtriangles, const int *element3i, const unsigned short *element3s, qbool wantnormals, qbool wanttangents)
#define BLENDFUNC_ALLOWS_ANYFOG
cvar_t r_transparentdepthmasking
static void R_DrawNoModel(entity_render_t *ent)
static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldorigin, const vec3_t worldnormal, float r, float g, float b, float a, float s1, float t1, float s2, float t2, float worldsize, unsigned int decalsequence)
static const char * builtinshaderstrings[]
cvar_t r_glsl_postprocess_uservec3
static void R_DrawTextureSurfaceList_ShowSurfaces(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth)
cvar_t r_glsl_offsetmapping_lod_distance
skinframe_t * R_SkinFrame_LoadInternal8bit(const char *name, int textureflags, const unsigned char *skindata, int width, int height, const unsigned int *palette, const unsigned int *alphapalette)
cvar_t cl_decals_newsystem_intensitymultiplier
void R_AnimCache_CacheVisibleEntities(void)
generate animcache data for all entities marked visible
static void R_DrawEntityBBoxes(prvm_prog_t *prog)
static int R_BlendFuncFlags(int src, int dst)
unsigned int r_queries[MAX_OCCLUSION_QUERIES]
cvar_t r_viewscale_fpsscaling
cvar_t r_texture_dds_save
void R_BuildLightMap(const entity_render_t *ent, msurface_t *surface, int combine)
void R_View_WorldVisibility(qbool forcenovis)
cvar_t r_q3bsp_renderskydepth
void R_PurgeTexture(rtexture_t *rt)
void R_FreeTexturePool(rtexturepool_t **rtexturepool)
int R_TextureFlags(rtexture_t *rt)
cvar_t gl_texturecompression_lightcubemaps
cvar_t gl_texturecompression
rtexture_t * R_LoadTextureRenderBuffer(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype)
void R_UpdateTexture(rtexture_t *rt, const unsigned char *data, int x, int y, int z, int width, int height, int depth, int combine)
cvar_t gl_texturecompression_reflectmask
cvar_t gl_texturecompression_color
rtexture_t * R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, qbool srgb, int flags, qbool *hasalphaflag, float *avgcolor, int miplevel, qbool optionaltexture)
int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qbool skipuncompressed, qbool hasalpha)
cvar_t gl_texturecompression_glow
rtexture_t * R_LoadTextureCubeMap(rtexturepool_t *rtexturepool, const char *identifier, int width, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette)
rtexturepool_t * R_AllocTexturePool(void)
void R_FreeTexture(rtexture_t *rt)
void R_Textures_Init(void)
void R_Textures_Frame(void)
cvar_t gl_texturecompression_gloss
int R_PicmipForFlags(int flags)
rtexture_t * R_LoadTexture2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette)
cvar_t gl_texturecompression_normal
GLuint GLuint GLintptr GLsizeiptr size
GLubyte GLubyte GLubyte z
GLenum GLenum GLuint texture
GLenum GLsizei GLsizei height
GLfloat GLfloat GLfloat v2
GLint GLint GLint yoffset
GLubyte GLubyte GLubyte GLubyte w
#define GL_UNIFORM_BUFFER
GLsizei const GLfloat * value
#define GL_FRONT_AND_BACK
#define GL_POLYGON_OFFSET_FILL
#define GL_ONE_MINUS_DST_ALPHA
#define GL_ONE_MINUS_DST_COLOR
GLint GLenum GLint GLint y
GLsizeiptr const GLvoid * data
#define GL_COLOR_BUFFER_BIT
GLuint GLuint GLintptr offset
#define GL_ONE_MINUS_SRC_ALPHA
GLint GLenum GLenum GLvoid * pixels
#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT
GLclampf GLclampf GLclampf alpha
GLsizei const GLchar ** string
#define GL_ACTIVE_UNIFORMS
#define GL_DEPTH_BUFFER_BIT
#define GL_ONE_MINUS_SRC_COLOR
unsigned char * Image_GenerateNoTexture(void)
void Image_HeightmapToNormalmap_BGRA(const unsigned char *inpixels, unsigned char *outpixels, int width, int height, int clamp, float bumpscale)
void Image_Copy8bitBGRA(const unsigned char *in, unsigned char *out, int pixels, const unsigned int *pal)
void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qbool inputflipx, qbool inputflipy, qbool inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices)
unsigned char * loadimagepixelsbgra(const char *filename, qbool complain, qbool allowFixtrans, qbool convertsRGB, int *miplevel)
qbool LoadPCX_QWSkin(const unsigned char *f, int filesize, unsigned char *pixels, int outwidth, int outheight)
void Image_StripImageExtension(const char *in, char *out, size_t size_out)
#define Image_sRGBFloatFromLinearFloat(c)
int LoopingFrameNumberFromDouble(double t, int loopframes)
void AnglesFromVectors(vec3_t angles, const vec3_t forward, const vec3_t up, qbool flippitch)
LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors.
void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void PlaneClassify(mplane_t *p)
#define VectorReflect(a, r, b, c)
#define Vector4Set(a, b, c, d, e)
#define VectorMAMAMAM(scale1, b1, scale2, b2, scale3, b3, scale4, b4, c)
#define VectorNegate(a, b)
#define BoxesOverlap(a, b, c, d)
#define VectorNormalize(v)
#define VectorLerp(v1, lerp, v2, c)
#define bound(min, num, max)
#define lhrandom(MIN, MAX)
LadyHavoc: this function never returns exactly MIN or exactly MAX, because of a QuakeC bug in id1 whe...
#define Vector4Copy(a, b)
#define VectorDistance2(a, b)
#define CrossProduct(a, b, c)
#define VectorMAM(scale1, b1, scale2, b2, c)
#define VectorCompare(a, b)
#define TriangleNormal(a, b, c, n)
#define PlaneDiff(point, plane)
#define VectorDistance(a, b)
#define VectorAdd(a, b, c)
#define VectorSet(a, b, c, d)
#define Vector4Add(a, b, c)
#define VectorSubtract(a, b, c)
#define VectorScale(in, scale, out)
#define VectorMA(a, scale, b, c)
#define VectorMAMAM(scale1, b1, scale2, b2, scale3, b3, c)
#define Vector4Multiply(a, b, c)
void Matrix4x4_Concat(matrix4x4_t *out, const matrix4x4_t *in1, const matrix4x4_t *in2)
void Matrix4x4_CreateIdentity(matrix4x4_t *out)
void Matrix4x4_TransformStandardPlane(const matrix4x4_t *in, float x, float y, float z, float d, float *o)
void Matrix4x4_FromArray12FloatGL(matrix4x4_t *out, const float in[12])
void Matrix4x4_Transform(const matrix4x4_t *in, const float v[3], float out[3])
void Matrix4x4_ToArrayFloatGL(const matrix4x4_t *in, float out[16])
void Matrix4x4_CreateTranslate(matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_Transform3x3(const matrix4x4_t *in, const float v[3], float out[3])
void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale)
int Matrix4x4_Invert_Full(matrix4x4_t *out, const matrix4x4_t *in1)
void Matrix4x4_CreateScale3(matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_ConcatScale3(matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_Normalize3(matrix4x4_t *out, matrix4x4_t *in1)
void Matrix4x4_Reflect(matrix4x4_t *out, double normalx, double normaly, double normalz, double dist, double axisscale)
void Matrix4x4_Invert_Simple(matrix4x4_t *out, const matrix4x4_t *in1)
void Matrix4x4_ConcatTranslate(matrix4x4_t *out, double x, double y, double z)
double Matrix4x4_ScaleFromMatrix(const matrix4x4_t *in)
void Matrix4x4_FromVectors(matrix4x4_t *out, const float vx[3], const float vy[3], const float vz[3], const float t[3])
void Matrix4x4_ToVectors(const matrix4x4_t *in, float vx[3], float vy[3], float vz[3], float t[3])
const matrix4x4_t identitymatrix
void Matrix4x4_ConcatRotate(matrix4x4_t *out, double angle, double x, double y, double z)
void Matrix4x4_OriginFromMatrix(const matrix4x4_t *in, float *out)
void R_MeshQueue_BeginScene(void)
void R_MeshQueue_AddTransparent(dptransparentsortcategory_t category, const vec3_t center, void(*callback)(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist), const entity_render_t *ent, int surfacenumber, const rtlight_t *rtlight)
void R_MeshQueue_RenderTransparent(void)
#define MESHQUEUE_TRANSPARENT_BATCHSIZE
void Mod_Skeletal_BuildTransforms(const model_t *RESTRICT model, const frameblend_t *RESTRICT frameblend, const skeleton_t *skeleton, float *RESTRICT bonepose, float *RESTRICT boneposerelative)
#define MATERIALFLAG_VERTEXCOLOR
#define MATERIALFLAG_FULLBRIGHT
#define MATERIALFLAG_ALPHA
#define MATERIALFLAG_REFRACTION
#define MATERIALFLAG_NODRAW
#define MATERIALFLAGMASK_DEPTHSORTED
#define MATERIALFLAG_ALPHATEST
#define MATERIALFLAG_CUSTOMSURFACE
#define MATERIALFLAG_BLENDED
#define MATERIALFLAG_TRANSDEPTH
#define MATERIALFLAG_VERTEXTEXTUREBLEND
#define MATERIALFLAG_WATERALPHA
#define MATERIALFLAG_LIGHTGRID
#define MATERIALFLAG_ALPHAGEN_VERTEX
#define MATERIALFLAG_WATERSHADER
#define MATERIALFLAG_MODELLIGHT
#define MATERIALFLAG_CAMERA
#define MATERIALFLAG_OCCLUDE
#define MATERIALFLAG_NODEPTHTEST
#define MATERIALFLAGMASK_TRANSLUCENT
#define MATERIALFLAG_WALL
#define MATERIALFLAG_NOSHADOW
#define MATERIALFLAG_REFLECTION
#define MATERIALFLAG_SHORTDEPTHRANGE
#define MATERIALFLAG_NOCULLFACE
#define MATERIALFLAG_WATERSCROLL
#define MATERIALFLAG_CUSTOMBLEND
#define MATERIALFLAG_NORTLIGHT
#define Q3SURFACEFLAG_NOMARKS
msurface_t * Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface)
int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a)
void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qbool areaweighting)
texture_t * Mod_Mesh_GetTexture(model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags)
void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2)
void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qbool areaweighting)
void Mod_RenderInit(void)
unsigned int palette_bgra_nocolormap[256]
unsigned int palette_bgra_transparent[256]
unsigned int palette_bgra_onlyfullbrights_transparent[256]
unsigned int palette_bgra_nocolormapnofullbrights[256]
unsigned int palette_bgra_shirtaswhite[256]
unsigned int palette_bgra_complete[256]
unsigned int palette_bgra_nofullbrights_transparent[256]
unsigned char palette_featureflags[256]
unsigned int palette_bgra_nofullbrights[256]
unsigned int palette_bgra_onlyfullbrights[256]
unsigned int palette_bgra_pantsaswhite[256]
#define PALETTEFEATURE_SHIRT
#define PALETTEFEATURE_GLOW
#define PALETTEFEATURE_PANTS
int PolygonF_Clip(int innumpoints, const float *inpoints, float planenormalx, float planenormaly, float planenormalz, float planedist, float epsilon, int outfrontmaxpoints, float *outfrontpoints)
void PolygonD_QuadForPlane(double *outpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double quadsize)
void PolygonD_Divide(int innumpoints, const double *inpoints, double planenormalx, double planenormaly, double planenormalz, double planedist, double epsilon, int outfrontmaxpoints, double *outfrontpoints, int *neededfrontpoints, int outbackmaxpoints, double *outbackpoints, int *neededbackpoints, int *oncountpointer)
#define PRVM_serveredictedict(ed, fieldname)
#define PRVM_gameedictedict(ed, fieldname)
#define PRVM_EDICT_NUM(n)
#define PRVM_serveredictfloat(ed, fieldname)
#define RENDER_EXTERIORMODEL
#define RENDER_DYNAMICMODELLIGHT
#define RENDER_WORLDOBJECT
#define RENDER_DOUBLESIDED
#define RENDER_NOSELFSHADOW
#define RENDER_CUSTOMIZEDMODELLIGHT
#define RENDER_NODEPTHTEST
#define MAX_WATERPLANES
max number of water planes visible (each one causes additional view renders)
#define MAX_EDICTS
max number of objects in game world at once (32768 protocol limit)
#define MAX_CUBEMAPS
max number of cubemap textures loaded for light filters
#define MAX_QPATH
max length of a quake game pathname
#define MAX_OCCLUSION_QUERIES
max number of query objects that can be used in one frame
#define MAX_DECALSYSTEM_QUEUE
void R_DrawExplosions(void)
void R_Explosion_Init(void)
void R_LightningBeams_Init(void)
void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
#define Q3WAVEFUNC_USER_COUNT
@ Q3DEFORM_PROJECTIONSHADOW
@ TRANSPARENTSORT_DISTANCE
#define Q3WAVEFUNC_USER_SHIFT
@ Q3TCMOD_ENTITYTRANSLATE
@ Q3WAVEFUNC_INVERSESAWTOOTH
cvar_t r_shadow_glossintensity
cvar_t r_shadow_bumpscale_bumpmap
float r_shadow_modelshadowmap_parameters[4]
rtexture_t * r_shadow_prepassgeometrynormalmaptexture
void R_Shadow_DrawShadowMaps(void)
qbool r_shadow_shadowmapvsdct
rtexture_t * r_shadow_viewdepthtexture
rtexture_t * r_shadow_attenuationgradienttexture
void R_Shadow_PrepareLights(void)
qbool R_Shadow_ShadowMappingEnabled(void)
float r_shadow_lightshadowmap_parameters[4]
void R_Shadow_PrepareModelShadows(void)
qbool r_shadow_usingshadowmap2d
cvar_t r_shadow_glossexact
float r_shadow_lightshadowmap_texturescale[4]
rtexture_t * r_shadow_viewcolortexture
qbool r_shadow_usingshadowmaportho
cvar_t r_shadow_frontsidecasting
void R_Shadow_UpdateBounceGridTexture(void)
rtexture_t * r_shadow_shadowmapvsdcttexture
rtexture_t * r_shadow_shadowmap2ddepthtexture
matrix4x4_t r_shadow_shadowmapmatrix
void R_Shadow_DrawCoronas(void)
cvar_t r_shadow_gloss2intensity
rtexture_t * r_shadow_shadowmap2ddepthbuffer
void R_Shadow_DrawLights(void)
cvar_t r_shadow_glossexponent
cvar_t r_shadow_gloss2exponent
void R_Shadow_DrawPrepass(void)
void R_Shadow_UpdateWorldLightSelection(void)
cvar_t r_shadow_bumpscale_basetexture
r_shadow_bouncegrid_state_t r_shadow_bouncegrid_state
void R_CompleteLightPoint(float *ambient, float *diffuse, float *lightdir, const vec3_t p, const int flags, float lightmapintensity, float ambientintensity)
float r_shadow_modelshadowmap_texturescale[4]
void R_SkyStartFrame(void)
void R_TimeReport(const char *desc)
@ r_stat_animcache_shape_count
@ r_stat_batch_fast_vertices
@ r_stat_batch_dynamic_triangles_because_deformvertexes_normal
@ r_stat_batch_entitycustom_surfaces
@ r_stat_batch_dynamic_vertices_because_deformvertexes_move
@ r_stat_batch_dynamic_surfaces_because_deformvertexes_wave
@ r_stat_batch_dynamic_batches_because_deformvertexes_autosprite
@ r_stat_batch_dynamic_surfaces_because_deformvertexes_move
@ r_stat_batch_dynamic_vertices_because_deformvertexes_normal
@ r_stat_batch_entityanimate_count
@ r_stat_framedatacurrent
@ r_stat_batch_dynamic_vertices_because_nogaps
@ r_stat_batch_dynamic_vertices_because_cvar
@ r_stat_batch_entitycache_triangles
@ r_stat_batch_dynamic_batches_because_deformvertexes_bulge
@ r_stat_batch_dynamic_batches_because_tcmod_turbulent
@ r_stat_batch_entityskeletal_vertices
@ r_stat_batch_dynamic_batches
@ r_stat_batch_dynamic_vertices_because_tcgen_lightmap
@ r_stat_batch_dynamic_surfaces_because_tcgen_environment
@ r_stat_batch_entitycustom_triangles
@ r_stat_animcache_skeletal_bones
@ r_stat_batch_dynamic_batches_because_deformvertexes_move
@ r_stat_rendertargets_used
@ r_stat_batch_entitystatic_surfaces
@ r_stat_batch_copytriangles_vertices
@ r_stat_batch_dynamic_vertices_because_deformvertexes_wave
@ r_stat_rendertargets_pixels
@ r_stat_batch_dynamic_triangles_because_cvar
@ r_stat_batch_dynamic_vertices_because_tcgen_environment
@ r_stat_batch_dynamic_batches_because_cvar
@ r_stat_batch_dynamic_batches_because_deformvertexes_wave
@ r_stat_batch_dynamic_triangles_because_deformvertexes_wave
@ r_stat_batch_dynamic_batches_because_lightmapvertex
@ r_stat_batch_dynamic_surfaces_because_deformvertexes_normal
@ r_stat_batch_copytriangles_batches
@ r_stat_entities_triangles
@ r_stat_animcache_shape_maxvertices
@ r_stat_bufferdatasize_vertex
@ r_stat_batch_dynamic_surfaces_because_tcgen_vector
@ r_stat_bloom_drawpixels
@ r_stat_batch_dynamic_surfaces_because_deformvertexes_autosprite2
@ r_stat_batch_dynamic_vertices
@ r_stat_batch_dynamic_triangles_because_deformvertexes_bulge
@ r_stat_batch_dynamic_triangles
@ r_stat_batch_entitycache_vertices
@ r_stat_batch_dynamic_surfaces_because_nogaps
@ r_stat_batch_entitycustom_vertices
@ r_stat_batch_dynamic_vertices_because_tcgen_vector
@ r_stat_batch_entitycache_surfaces
@ r_stat_batch_entityanimate_surfaces
@ r_stat_batch_dynamic_surfaces_because_deformvertexes_autosprite
@ r_stat_batch_dynamicskeletal_triangles
@ r_stat_batch_dynamicskeletal_batches
@ r_stat_batch_entitycustom_count
@ r_stat_batch_dynamic_surfaces_because_tcgen_lightmap
@ r_stat_batch_dynamicskeletal_vertices
@ r_stat_animcache_skeletal_maxbones
@ r_stat_batch_dynamic_batches_because_nogaps
@ r_stat_entities_surfaces
@ r_stat_batch_copytriangles_surfaces
@ r_stat_batch_fast_surfaces
@ r_stat_batch_dynamic_batches_because_tcgen_environment
@ r_stat_batch_dynamic_triangles_because_deformvertexes_autosprite2
@ r_stat_batch_dynamic_surfaces_because_tcmod_turbulent
@ r_stat_animcache_skeletal_count
@ r_stat_batch_dynamic_batches_because_deformvertexes_normal
@ r_stat_batch_dynamic_surfaces_because_cvar
@ r_stat_batch_entitystatic_triangles
@ r_stat_batch_dynamic_batches_because_deformvertexes_autosprite2
@ r_stat_batch_dynamic_vertices_because_deformvertexes_bulge
@ r_stat_batch_dynamic_triangles_because_tcgen_environment
@ r_stat_batch_fast_triangles
@ r_stat_animcache_shade_count
@ r_stat_batch_entitystatic_count
@ r_stat_batch_dynamic_batches_because_tcgen_vector
@ r_stat_batch_dynamic_triangles_because_lightmapvertex
@ r_stat_batch_dynamic_triangles_because_nogaps
@ r_stat_batch_dynamic_triangles_because_deformvertexes_autosprite
@ r_stat_batch_dynamic_surfaces_because_deformvertexes_bulge
@ r_stat_batch_entityskeletal_surfaces
@ r_stat_batch_copytriangles_triangles
@ r_stat_batch_fast_batches
@ r_stat_batch_dynamicskeletal_surfaces
@ r_stat_batch_dynamic_vertices_because_lightmapvertex
@ r_stat_bloom_copypixels
@ r_stat_batch_dynamic_vertices_because_deformvertexes_autosprite2
@ r_stat_batch_dynamic_batches_because_tcgen_lightmap
@ r_stat_batch_dynamic_surfaces_because_lightmapvertex
@ r_stat_batch_entitystatic_vertices
@ r_stat_batch_dynamic_vertices_because_deformvertexes_autosprite
@ r_stat_batch_entityanimate_vertices
@ r_stat_animcache_shape_vertices
@ r_stat_batch_dynamic_vertices_because_tcmod_turbulent
@ r_stat_batch_entitycache_count
@ r_stat_animcache_shade_vertices
@ r_stat_batch_entityskeletal_triangles
@ r_stat_batch_dynamic_triangles_because_tcgen_vector
@ r_stat_animcache_shade_maxvertices
@ r_stat_batch_dynamic_triangles_because_tcmod_turbulent
@ r_stat_bufferdatacurrent_vertex
@ r_stat_batch_entityskeletal_count
@ r_stat_batch_entityanimate_triangles
@ r_stat_batch_dynamic_surfaces
@ r_stat_batch_dynamic_triangles_because_deformvertexes_move
@ r_stat_batch_dynamic_triangles_because_tcgen_lightmap
#define TEXF_IMPORTANTBITS
#define TEXF_FORCENEAREST
@ TEXTYPE_DEPTHBUFFER24STENCIL8
#define TEXF_FORCE_RELOAD
#define TEXF_RENDERTARGET
r_bufferdata_type_t
enum of the various types of hardware buffer object used in rendering note that the r_buffermegs[] ar...
@ R_BUFFERDATA_COUNT
uniform buffer
@ R_BUFFERDATA_UNIFORM
index buffer - 32bit (because D3D cares)
@ R_BUFFERDATA_INDEX32
index buffer - 16bit (because D3D cares)
@ R_BUFFERDATA_INDEX16
vertex buffer
#define SHADERPERMUTATION_FOGALPHAHACK
fog color and density determined by texture mapped on vertical axis
#define SHADERPERMUTATION_SKELETAL
(skeletal models) use skeletal matrices to deform vertices (gpu-skinning)
#define SHADERPERMUTATION_SPECULAR
(lightsource or deluxemapping) render specular effects
#define SHADERPERMUTATION_POSTPROCESSING
user defined postprocessing (postprocessing only)
#define SHADERPERMUTATION_COUNT
size of shaderpermutationinfo array
#define SHADERPERMUTATION_BLOOM
bloom (postprocessing only)
@ SHADERMODE_DEFERREDGEOMETRY
(deferred) render material properties to screenspace geometry buffers
@ SHADERMODE_FLATCOLOR
(lightmap) modulate texture by uniform color (q1bsp, q3bsp)
@ SHADERMODE_LIGHTDIRECTION
(lightmap) use directional pixel shading from fixed light direction (q3bsp)
@ SHADERMODE_VERTEXCOLOR
(lightmap) modulate texture by vertex colors (q3bsp)
@ SHADERMODE_LIGHTDIRECTIONMAP_MODELSPACE
(lightmap) use directional pixel shading from texture containing modelspace light directions (q3bsp d...
@ SHADERMODE_LIGHTMAP
(lightmap) modulate texture by lightmap texture (q1bsp, q3bsp)
@ SHADERMODE_LIGHTDIRECTIONMAP_FORCED_LIGHTMAP
@ SHADERMODE_GENERIC
(particles/HUD/etc) vertex color, optionally multiplied by one texture
@ SHADERMODE_POSTPROCESS
postprocessing shader (r_glsl_postprocess)
@ SHADERMODE_LIGHTDIRECTIONMAP_TANGENTSPACE
(lightmap) use directional pixel shading from texture containing tangentspace light directions (q1bsp...
@ SHADERMODE_DEFERREDLIGHTSOURCE
(deferred) use directional pixel shading from light source (rtlight) on screenspace geometry buffers
@ SHADERMODE_WATER
refract background and reflection (the material is rendered normally after this pass)
@ SHADERMODE_DEPTH_OR_SHADOW
(depthfirst/shadows) vertex shader only
@ SHADERMODE_LIGHTSOURCE
(lightsource) use directional pixel shading from light source (rtlight)
@ SHADERMODE_LIGHTGRID
(lightmap) use directional pixel shading from lightgrid data (q3bsp)
@ SHADERMODE_LIGHTDIRECTIONMAP_FORCED_VERTEXCOLOR
@ SHADERMODE_REFRACTION
refract background (the material is rendered normally after this pass)
#define SHADERPERMUTATION_ALPHAKILL
(deferredgeometry) discard pixel if diffuse texture alpha below 0.5, (generic) apply global alpha
#define SHADERPERMUTATION_ALPHAGEN_VERTEX
alphaGen vertex
#define FOGMASKTABLEWIDTH
#define SHADERPERMUTATION_DEPTHRGB
read/write depth values in RGB color coded format for older hardware without depth samplers
#define SHADERPERMUTATION_GLOW
(lightmap) blend in an additive glow texture
#define SHADERPERMUTATION_FOGHEIGHTTEXTURE
fog color and density determined by texture mapped on vertical axis
#define SHADERPERMUTATION_BOUNCEGRIDDIRECTIONAL
(lightmap) use 16-component pixels in bouncegrid texture for directional lighting rather than standar...
#define SHADERPERMUTATION_FOGOUTSIDE
tint the color by fog color or black if using additive blend mode
#define BATCHNEED_ALLOWMULTIDRAW
#define SHADERPERMUTATION_SHADOWMAPVSDCT
(lightsource) use virtual shadow depth cube texture for shadowmap indexing
#define SHADERPERMUTATION_VIEWTINT
view tint (postprocessing only), use vertex colors (generic only)
#define BATCHNEED_ARRAY_VERTEXCOLOR
#define BATCHNEED_ARRAY_NORMAL
#define BATCHNEED_ALWAYSCOPY
#define SHADERPERMUTATION_OCCLUDE
use occlusion buffer for corona
#define BATCHNEED_ARRAY_SKELETAL
#define BATCHNEED_ARRAY_LIGHTMAP
#define SHADERPERMUTATION_OFFSETMAPPING
adjust texcoords to roughly simulate a displacement mapped surface
#define SHADERPERMUTATION_SHADOWMAP2D
(lightsource) use shadowmap texture as light filter
#define SHADERPERMUTATION_BOUNCEGRID
(lightmap) use Texture_BounceGrid as an additional source of ambient light
#define SHADERPERMUTATION_VERTEXTEXTUREBLEND
indicates this is a two-layer material blend based on vertex alpha (q3bsp)
#define BATCHNEED_ARRAY_VECTOR
#define SHADERPERMUTATION_FOGINSIDE
tint the color by fog color or black if using additive blend mode
#define SHADERPERMUTATION_NORMALMAPSCROLLBLEND
(water) counter-direction normalmaps scrolling
#define SHADERPERMUTATION_SHADOWMAPORTHO
(lightsource) use orthographic shadowmap projection
#define BATCHNEED_ARRAY_VERTEX
#define SHADERPERMUTATION_CUBEFILTER
(lightsource) use cubemap light filter
#define SHADERPERMUTATION_REFLECTION
normalmap-perturbed reflection of the scene infront of the surface, preformed as an overlay on the su...
@ RSURFPASS_DEFERREDGEOMETRY
#define SHADERPERMUTATION_REFLECTCUBE
fake reflections using global cubemap (not HDRI light probe)
#define SHADERPERMUTATION_SATURATION
saturation (postprocessing only)
#define SHADERPERMUTATION_DEFERREDLIGHTMAP
(lightmap) read Texture_ScreenDiffuse/Specular textures and add them on top of lightmapping
#define SHADERPERMUTATION_COLORMAPPING
indicates this is a colormapped skin
#define SHADERPERMUTATION_GAMMARAMPS
gamma (postprocessing only)
#define SHADERPERMUTATION_TRIPPY
use trippy vertex shader effect
#define BATCHNEED_ARRAY_TEXCOORD
#define SHADERPERMUTATION_OFFSETMAPPING_RELIEFMAPPING
adjust texcoords to accurately simulate a displacement mapped surface (requires OFFSETMAPPING to also...
#define SHADERPERMUTATION_DIFFUSE
(lightsource) whether to use directional shading
#define SOLID_BBOX
touch on edge, block
#define SOLID_SLIDEBOX
touch on edge, but not an onground
#define SOLID_CORPSE
same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
#define SOLID_NOT
no interaction with other objects
#define SOLID_TRIGGER
touch on edge, but not blocking
#define SOLID_BSP
bsp clip, touch on edge, block
uniform highp float FogHeightFade
vec3 float FogPlaneVertexDist
uniform highp float FogPlaneViewDist
unsigned int decalsequence
cshift_t cshifts[NUM_CSHIFTS]
struct model_s * worldmodel
csqc_vidvars_t csqc_vidvars
char worldnamenoextension[MAX_QPATH]
protocolversion_t protocol
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
unsigned short * element3s
frameblend_t frameblend[MAX_FRAMEBLENDS]
float render_fullbright[3]
vec_t userwavefunc_param[Q3WAVEFUNC_USER_COUNT]
float * animcache_skeletaltransform3x4
float render_rtlight_diffuse[3]
matrix4x4_t inversematrix
r_meshbuffer_t * animcache_vertex3f_vertexbuffer
float render_modellight_specular[3]
float * animcache_normal3f
int animcache_skeletaltransform3x4size
qbool render_rtlight_disabled
int animcache_vertex3f_bufferoffset
r_meshbuffer_t * animcache_svector3f_vertexbuffer
float render_modellight_lightdir_world[3]
float render_lightmap_ambient[3]
decalsystem_t decalsystem
float render_modellight_lightdir_local[3]
vec3_t colormap_shirtcolor
r_meshbuffer_t * animcache_tvector3f_vertexbuffer
qbool render_modellight_forced
framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS]
double last_trace_visibility
float * animcache_vertex3f
float render_lightmap_diffuse[3]
int animcache_svector3f_bufferoffset
float render_modellight_ambient[3]
float render_rtlight_specular[3]
float render_lightmap_specular[3]
r_meshbuffer_t * animcache_skeletaltransform3x4buffer
r_meshbuffer_t * animcache_normal3f_vertexbuffer
float render_modellight_diffuse[3]
float * animcache_svector3f
int animcache_tvector3f_bufferoffset
float * animcache_tvector3f
vec3_t colormap_pantscolor
int animcache_skeletaltransform3x4offset
int animcache_normal3f_bufferoffset
int(* BoxTouchingVisibleLeafs)(struct model_s *model, const unsigned char *visibleleafs, const vec3_t mins, const vec3_t maxs)
struct q3mbrush_s * data_brushes
qbool(* TraceLineOfSight)(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
size_t(* FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, unsigned char **pvsbuffer, mempool_t *pool, qbool merge)
mleaf_t *(* PointInLeaf)(struct model_s *model, const vec3_t p)
int * data_collisionelement3i
float * data_collisionvertex3f
model_brush_lightstyleinfo_t * data_lightstyleinfo
unsigned char * lightmapupdateflags
matrix4x4_t lightgridworldtotexturematrix
qbool deluxemapping_modelspace
rtexture_t * lightgridtexture
void(* AnimateVertices)(const struct model_s *RESTRICT model, const struct frameblend_s *RESTRICT frameblend, const struct skeleton_s *skeleton, float *RESTRICT vertex3f, float *RESTRICT normal3f, float *RESTRICT svector3f, float *RESTRICT tvector3f)
void(* DrawDepth)(struct entity_render_s *ent)
int * modelsurfaces_sorted
surface indices of model in an optimal draw order (submodelindex -> texture -> lightmap -> index)
msurface_t * data_surfaces
void(* Draw)(struct entity_render_s *ent)
int submodelsurfaces_start
void(* DrawSky)(struct entity_render_s *ent)
void(* DrawAddWaterPlanes)(struct entity_render_s *ent)
void(* DrawDebug)(struct entity_render_s *ent)
describes the textures to use on a range of triangles in the model, and mins/maxs (AABB) for culling.
int num_triangles
range of triangles and vertices in model->surfmesh
texture_t * texture
the texture to use on the surface
struct rtexture_s * deluxemaptexture
the lighting direction texture fragment to use on the rendering mesh
struct rtexture_s * lightmaptexture
the lightmap texture fragment to use on the rendering mesh
union prvm_edict_t::@25 priv
struct edict_engineprivate_s * server
struct colbrushf_s * colbrushf
float parms[Q3TCGEN_MAXPARMS]
float parms[Q3TCMOD_MAXPARMS]
float waveparms[Q3WAVEPARMS]
struct r_bufferdata_buffer_s * purge
unsigned int decalsequence
memexpandablearray_t rendertargets
r_rendertarget_t * rt_bloom
float offsettexcoord2f[8]
rtexture_t * ghosttexture
r_rendertarget_t * rt_screen
struct r_framedata_mem_s * purge
int loc_Texture_FogHeightTexture
int loc_Texture_ScreenSpecular
int tex_Texture_Deluxemap
int loc_ModelToReflectCube
int loc_Texture_Attenuation
int tex_Texture_ShadowMap2D
int loc_Texture_Refraction
int loc_Texture_BounceGrid
int tex_Texture_SecondaryNormal
int tex_Texture_GammaRamps
int tex_Texture_BounceGrid
int loc_Texture_ScreenDiffuse
int loc_OffsetMapping_Bias
int loc_Texture_ShadowMap2D
int loc_Skeletal_Transform12
int loc_Texture_First
locations of detected uniforms in program object, or -1 if not found
int loc_Texture_LightGrid
int tex_Texture_LightGrid
int tex_Texture_FogHeightTexture
int tex_Texture_ReflectMask
int loc_DeferredColor_Specular
int tex_Texture_ScreenDiffuse
int tex_Texture_ReflectCube
int loc_DeferredMod_Diffuse
int loc_Texture_SecondaryGlow
int loc_ScreenCenterRefractReflect
int loc_Texture_SecondaryNormal
int loc_PixelToScreenTexCoord
int loc_Texture_ScreenNormalMap
int loc_Texture_Deluxemap
int program
0 if compilation failed
struct r_glsl_permutation_s * hashnext
hash lookup data
int ubibind_Skeletal_Transform12_UniformBlock
uniform block bindings
int loc_ShadowMap_TextureScale
int tex_Texture_ScreenSpecular
int loc_ShadowMap_Parameters
int tex_Texture_SecondaryColor
qbool compiled
indicates if we have tried compiling this permutation already
int loc_Texture_SecondaryGloss
int loc_DeferredColor_Ambient
int loc_DeferredColor_Diffuse
int ubiloc_Skeletal_Transform12_UniformBlock
uniform block indices
int loc_BloomBlur_Parameters
int loc_DeferredMod_Specular
int loc_BloomColorSubtract
int loc_Texture_GammaRamps
int tex_Texture_SecondaryGloss
int tex_Texture_Refraction
int loc_NormalmapScrollBlend
int loc_Texture_Reflection
int loc_ScreenScaleRefractReflect
int loc_OffsetMapping_ScaleSteps
int loc_DistortScaleRefractReflect
int loc_OffsetMapping_LodDistance
int tex_Texture_Attenuation
int loc_LightGridNormalMatrix
int tex_Texture_CubeProjection
int loc_Texture_SecondaryColor
int loc_Texture_ReflectCube
int loc_Texture_CubeProjection
int loc_BackgroundTexMatrix
int tex_Texture_ScreenNormalMap
int loc_Texture_ReflectMask
int tex_Texture_Reflection
int loc_BounceGridIntensity
int tex_Texture_SecondaryGlow
int loc_ModelViewProjectionMatrix
qbool extraupdate
whether to call S_ExtraUpdate during render to reduce sound chop
float rtlightstylevalue[MAX_LIGHTSTYLES]
float fraction of base light value
entity_render_t ** entities
renderable entities (excluding world)
model_t * worldmodel
same as worldentity->model
unsigned short lightstylevalue[MAX_LIGHTSTYLES]
8.8 fraction of base light value
entity_render_t * worldentity
the world
double time
(client gameworld) time for rendering time based effects
float fogmasktable[FOGMASKTABLEWIDTH]
float fog_height_texcoordscale
r_refdef_viewcache_t viewcache
char fog_height_texturename[64]
float fog_height_tablescale
double lastdrawscreentime
float fogmasktabledistmultiplier
unsigned char * fog_height_table1d
unsigned char * fog_height_table2d
char fogheighttexturename[64]
float fogmasktable_density
qbool clear
whether to call R_ClearScreen before rendering stuff
qbool usecustompvs
uses r_refdef.viewcache.pvsbits as-is rather than computing it
float colorscale
global RGB color multiplier for rendering
float quality
render quality (0 to 1) - affects r_drawparticles_drawdistance and others
int useperspective
if turned off it renders an ortho view
qbool isoverlay
if true, don't clear or do any post process effects (bloom, etc)
r_viewport_t viewport
note: if r_viewscale is used, the viewport.width and viewport.height may be less than width and heigh...
qbool ismain
if true, this is the MAIN view (which is, after CSQC, copied into the scene for use e....
int colormask[4]
which color components to allow (for anaglyph glasses)
matrix4x4_t inverse_matrix
int usevieworiginculling
allows visibility culling based on the view origin (e.g.
unsigned char * world_leafvisible
unsigned char * world_pvsbits
qbool world_novis
if true, the view is currently in a leaf without pvs data
unsigned char * world_surfacevisible
unsigned char * entityvisible
which entities are currently visible for this viewpoint (the used range is 0...r_refdef....
rtexture_t * depthtexture
textype_t colortextype[4]
rtexture_t * colortexture[4]
struct rtexture_s * texture
unsigned int loadsequence
skinframe_t * hash[SKINFRAME_HASH]
memexpandablearray_t array
float screentodepth[2]
used by deferred renderer to calculate linear depth from device depth coordinates
matrix4x4_t viewmatrix
actual matrix for rendering (transforms to viewspace)
r_waterstate_waterplane_t waterplanes[MAX_WATERPLANES]
r_rendertarget_t * rt_refraction
r_rendertarget_t * rt_camera
r_rendertarget_t * rt_reflection
int batchskeletalindex4ub_bufferoffset
int batchvertex3f_bufferoffset
int modelskeletalweight4ub_bufferoffset
float * modellightmapcolor4f
unsigned short * batchelement3s
const msurface_t * modelsurfaces
float * entityskeletaltransform3x4
unsigned char * modelskeletalindex4ub
const rtlight_t * rtlight
const msurface_t ** batchmultidrawsurfacelist
int modeltvector3f_bufferoffset
int batchskeletalweight4ub_bufferoffset
int batchelement3s_bufferoffset
float * batchtexcoordlightmap2f
float * batchtexcoordtexture2f
int batchelement3i_bufferoffset
int modelelement3i_bufferoffset
const r_meshbuffer_t * batchtexcoordlightmap2f_vertexbuffer
int modelsvector3f_bufferoffset
unsigned short * modelelement3s
matrix4x4_t entitytolight
rtexture_t * lightmaptexture
int batchtexcoordlightmap2f_bufferoffset
int modeltexcoordlightmap2f_bufferoffset
int * modellightmapoffsets
const r_meshbuffer_t * modellightmapcolor4f_vertexbuffer
int modelelement3s_bufferoffset
int batchnormal3f_bufferoffset
unsigned char * batchskeletalindex4ub
const r_meshbuffer_t * batchlightmapcolor4f_vertexbuffer
const r_meshbuffer_t * modeltexcoordlightmap2f_vertexbuffer
const r_meshbuffer_t * batchsvector3f_vertexbuffer
qbool modelgeneratedvertex
float fogmasktabledistmultiplier
float * modeltexcoordtexture2f
int modellightmapcolor4f_bufferoffset
const r_meshbuffer_t * batchtvector3f_vertexbuffer
rtexture_t * deluxemaptexture
int batchlightmapcolor4f_bufferoffset
const r_meshbuffer_t * entityskeletaltransform3x4buffer
unsigned char * modelskeletalweight4ub
const r_meshbuffer_t * modelvertex3f_vertexbuffer
const r_meshbuffer_t * batchvertex3f_vertexbuffer
const r_meshbuffer_t * modelnormal3f_vertexbuffer
int modelnormal3f_bufferoffset
int entityskeletaltransform3x4size
const r_meshbuffer_t * modelelement3s_indexbuffer
int batchtvector3f_bufferoffset
int entityskeletaltransform3x4offset
const r_meshbuffer_t * modeltvector3f_vertexbuffer
const r_meshbuffer_t * batchtexcoordtexture2f_vertexbuffer
int modelskeletalindex4ub_bufferoffset
const r_meshbuffer_t * batchskeletalweight4ub_vertexbuffer
int entityskeletalnumtransforms
const r_meshbuffer_t * batchskeletaltransform3x4buffer
int batchskeletalnumtransforms
const r_meshbuffer_t * batchelement3i_indexbuffer
float * modeltexcoordlightmap2f
int modelvertex3f_bufferoffset
int batchskeletaltransform3x4size
frameblend_t frameblend[MAX_FRAMEBLENDS]
const r_meshbuffer_t * batchnormal3f_vertexbuffer
int modeltexcoordtexture2f_bufferoffset
const r_meshbuffer_t * modelskeletalindex4ub_vertexbuffer
float userwavefunc_param[Q3WAVEFUNC_USER_COUNT]
int batchskeletaltransform3x4offset
int batchmultidrawnumsurfaces
unsigned char * batchskeletalweight4ub
const r_meshbuffer_t * modelelement3i_indexbuffer
const r_meshbuffer_t * modelsvector3f_vertexbuffer
qbool forcecurrenttextureupdate
const r_meshbuffer_t * modelskeletalweight4ub_vertexbuffer
float * batchskeletaltransform3x4
int batchsvector3f_bufferoffset
int batchtexcoordtexture2f_bufferoffset
matrix4x4_t inversematrix
const r_meshbuffer_t * batchelement3s_indexbuffer
const r_meshbuffer_t * batchskeletalindex4ub_vertexbuffer
qbool batchgeneratedvertex
float * batchlightmapcolor4f
const r_meshbuffer_t * modeltexcoordtexture2f_vertexbuffer
vec_t ambientscale
ambient intensity to render
rtexture_t * currentcubemap
this is R_GetCubemap(rtlight->cubemapname)
vec_t specularscale
specular intensity to render
vec3_t shadoworigin
used only for casting shadows
matrix4x4_t matrix_lighttoworld
matrix for transforming light filter coordinates to world coordinates
vec_t diffusescale
diffuse intensity to render
qbool active
false if only a net client
const char ** builtinshaderstrings
const char * sourcebasename
struct matrix4x4_s * relativetransforms
struct rtexture_s * pants
struct rtexture_s * stain
struct rtexture_s * merged
struct rtexture_s * shirt
struct skinframe_s * next
struct rtexture_s * reflect
struct rtexture_s * gloss
unsigned int loadsequence
r_meshbuffer_t * data_svector3f_vertexbuffer
int data_normal3f_bufferoffset
int data_element3s_bufferoffset
int data_skeletalweight4ub_bufferoffset
r_meshbuffer_t * data_lightmapcolor4f_vertexbuffer
r_meshbuffer_t * data_normal3f_vertexbuffer
int data_element3i_bufferoffset
int data_texcoordlightmap2f_bufferoffset
int data_skeletalindex4ub_bufferoffset
int data_svector3f_bufferoffset
float * data_lightmapcolor4f
unsigned char * data_skeletalweight4ub
unsigned char * data_skeletalindex4ub
unsigned short * data_element3s
r_meshbuffer_t * data_texcoordtexture2f_vertexbuffer
r_meshbuffer_t * data_skeletalindex4ub_vertexbuffer
r_meshbuffer_t * data_tvector3f_vertexbuffer
r_meshbuffer_t * data_element3i_indexbuffer
int * data_lightmapoffsets
int data_texcoordtexture2f_bufferoffset
int data_tvector3f_bufferoffset
r_meshbuffer_t * data_texcoordlightmap2f_vertexbuffer
r_meshbuffer_t * data_skeletalweight4ub_vertexbuffer
int data_vertex3f_bufferoffset
int data_lightmapcolor4f_bufferoffset
float * data_texcoordtexture2f
r_meshbuffer_t * data_element3s_indexbuffer
float * data_texcoordlightmap2f
r_meshbuffer_t * data_vertex3f_vertexbuffer
q3shaderinfo_layer_tcmod_t tcmods[Q3MAXTCMODS]
struct skinframe_s * skinframes[TEXTURE_MAXFRAMES]
q3shaderinfo_layer_tcgen_t tcgen
struct skinframe_s * backgroundcurrentskinframe
struct rtexture_s * basetexture
float render_rtlight_specular[3]
matrix4x4_t currenttexmatrix
struct rtexture_s * glosstexture
float render_modellight_lightdir_world[3]
dptransparentsortcategory_t transparentsort
float render_colormap_pants[3]
struct rtexture_s * nmaptexture
dpoffsetmapping_technique_t offsetmapping
struct rtexture_s * backgroundglosstexture
struct rtexture_s * backgroundbasetexture
texture_shaderpass_t * backgroundshaderpass
void * update_lastrenderentity
float render_colormap_shirt[3]
float r_water_waterscroll[2]
float render_modellight_diffuse[3]
float render_rtlight_diffuse[3]
float render_modellight_ambient[3]
struct rtexture_s * shirttexture
struct rtexture_s * pantstexture
struct texture_s * currentframe
struct rtexture_s * glowtexture
int update_lastrenderframe
float render_modellight_lightdir_local[3]
struct rtexture_s * backgroundglowtexture
q3shaderinfo_deform_t deforms[Q3MAXDEFORMS]
float render_lightmap_specular[3]
struct rtexture_s * reflectmasktexture
matrix4x4_t currentbackgroundtexmatrix
struct rtexture_s * fogtexture
struct rtexture_s * reflectcubetexture
float render_lightmap_diffuse[3]
texture_shaderpass_t * materialshaderpass
float render_lightmap_ambient[3]
struct rtexture_s * backgroundnmaptexture
float render_modellight_specular[3]
struct skinframe_s * currentskinframe
struct texture_s * anim_frames[2][10]
qbool ext_texture_compression_s3tc
unsigned int maxtexturesize_2d
viddef_mode_t mode
currently active video mode
qbool allowalphatocoverage
void Sys_Error(const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
Causes the entire program to exit ASAP.
qbool vid_gammatables_trivial
unsigned int vid_gammatables_serial
void VID_BuildGammaTables(unsigned short *ramps, int rampsize)
size_t Mem_ExpandableArray_IndexRange(const memexpandablearray_t *l)
void Mem_ExpandableArray_NewArray(memexpandablearray_t *l, mempool_t *mempool, size_t recordsize, int numrecordsperarray)
void Mem_ExpandableArray_FreeRecord(memexpandablearray_t *l, void *record)
void * Mem_ExpandableArray_AllocRecord(memexpandablearray_t *l)
void * Mem_ExpandableArray_RecordAtIndex(const memexpandablearray_t *l, size_t index)
void Mem_ExpandableArray_FreeArray(memexpandablearray_t *l)
#define Mem_Alloc(pool, size)
#define Mem_strdup(pool, s)
#define Mem_AllocPool(name, flags, parent)